Preact-cli: preact.config.js snippets

Created on 4 Jul 2017  路  6Comments  路  Source: preactjs/preact-cli

As it is now possible to change the configuration via preact.config.js, some useful snippets can be found in several issues: https://github.com/developit/preact-cli/search?q=preact.config.js&type=Issues&utf8=%E2%9C%93

May it be worth to collect (some of) them here in the Github Wiki or in a README? It may be hard to maintain, what do you think about it?

Most helpful comment

Github already has a Wiki section, what do you think @developit ?

All 6 comments

Agreed. I think the quickest thing that can be done is to add a short paragraph in the README to say that WebpackConfigHelpers is very useful for changing the webpack config. Here's a suggestion of what can be added to the README:

Use the helpers argument to easily modify the config object. For example, you can disable the sourceMaps option of UgflifyJsPlugin like this:

helpers.getPluginsByName(config, "UglifyJsPlugin")[0].plugin.options.sourceMap = false;

Github already has a Wiki section, what do you think @developit ?

That would be great !! That makes the README clean too !!

Just dropping a note here - I think plugins would make this even better. I'm fine with the wiki, since these are likely too specific and lengthy for the readme itself.

Filled with recipes

Was this page helpful?
0 / 5 - 0 ratings