preactjs-templates / widget

Template for a widget to be embedded in another website
MIT License
88 stars 19 forks source link

Disable extracting CSS into separate file on latest preact-cli (v3.0.5) #15

Closed billdami closed 2 years ago

billdami commented 3 years ago

It appears preact-cli has switched from ExtractTextPlugin to MiniCssExtractPlugin in newer releases for extracting the build's CSS into a separate file, which obviously causes this in the preact.config.js file to fail:

let { plugin } = helpers.getPluginsByName(config, "ExtractTextPlugin")[0];
plugin.options.disable = true;

I didn't see any option in the MiniCssExtractPlugin config that allows it to be completely disabled, is there another way of doing this?

ForsakenHarmony commented 3 years ago

I suppose one way would be to remove the plugin/loader entirely from the config 🤔

billdami commented 3 years ago

@ForsakenHarmony thanks for the reply, though I ended up going with a different forked template for my needs. Out of curiosity, whats the best way to remove the plugin/loader from the config, since the config itself is baked into preact-cli? Is there APIs for doing that?

ForsakenHarmony commented 3 years ago

There isn't, you'd have to get the plugin and then splice it from the plugins array