razzle icon indicating copy to clipboard operation
razzle copied to clipboard

Make usage of `mini-css-extract-plugin` optional

Open dios-david opened this issue 4 years ago • 2 comments

🚀 Feature request

Current Behavior

I have to install mini-css-extract-plugin in order to make Razzle 4 work.

Desired Behavior

Razzle 4 is usable without mini-css-extract-plugin if the project doesn't need that.

Suggested Solution

a) Make createConfigAsync.js to load this plugin only when it's actually used b) Add a config option to disable css/style handling in default config (and leave it turned on by default for backward compatibility)

Who does this impact? Who is this for?

Projects without css (e.g. using a css-in-js solution).

Describe alternatives you've considered

Haven't tried this, but probably I could create a local mini-css-extract-plugin dummy project and point mini-css-extract-plugin to that folder with file:... in my package.json.

I can also install this package, but technically I don't need that, so... that's why I thought I should point this out.

dios-david avatar Apr 12 '21 16:04 dios-david

Ideally every part of razzle should be a plugin. Then have a default set of core plugins.

fivethreeo avatar Apr 13 '21 01:04 fivethreeo

I think when buildType is set to serveronly or serverless, mini-css-extract-plugin, postcss and html-webpack-plugin should be disabled by default, we can check if package is actually installed and only add in the chain if they're installed

ceopaludetto avatar Apr 16 '21 17:04 ceopaludetto