emulsify-ds / emulsify-drupal

Drupal theme built with Storybook and Webpack
GNU General Public License v2.0
92 stars 42 forks source link

How can I configure emulsify's webpack to compile multiple css files instead or beside the single style.css #246

Closed israelshmueli closed 2 years ago

israelshmueli commented 2 years ago

emulsify version: I believe this relates to all versions

In current project I rely on attach_library() and Drupal's compression instead of using single style.css . I have read your answer to issue 222 but still, for my case prefer using separate css and js files for each component.

This works fine but still slightly different then the main style.css. I guess this is because the postcss step is still missing.

I tried

  1. Listing more than a single file in webpack/css.js did not worked.
  2. I did not find any proper way to add more css entries inside webpack/webpack.common.js getEntries function and this also failed

Currently Emulsify's weback config outputs multiple separate JS files into dist/js folder and this is excellent for attach_library() usage. But for compiling multiple scss files into multiple css files I had to modify the package.json scripts section, by adding new node-sass watch/compile line and then concat it do the "develop" script.

Since both, Storybook and Emulsify rely on Webpack for the build I much prefer to hook also my multiple css files setup to use it.

Can you please guide me how to make it work?

israelshmueli commented 2 years ago

I manage to acomplish this and created pull request with my proposed solution

amazingrando commented 2 years ago

Resolved by #247