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

Created on 12 Apr 2021  路  2Comments  路  Source: jaredpalmer/razzle

馃殌 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.

Most helpful comment

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

All 2 comments

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcblw picture jcblw  路  4Comments

MaxGoh picture MaxGoh  路  4Comments

dizzyn picture dizzyn  路  3Comments

pseudo-su picture pseudo-su  路  3Comments

charlie632 picture charlie632  路  4Comments