Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add any plugin? #58

Closed
apfz opened this issue Feb 13, 2019 · 3 comments
Closed

How to add any plugin? #58

apfz opened this issue Feb 13, 2019 · 3 comments
Labels
❓ question Further information is requested

Comments

@apfz
Copy link

apfz commented Feb 13, 2019

Hi, great tool!

Could you explain to me how I can override or add to the original Webpack config?

I would like to add the following plugin to Webpack:

https://www.npmjs.com/package/bless-css-webpack-plugin#usage

Thanks!

@bfischer1121
Copy link

If you pass a function to override, customize-cra will call it with the webpack config object, like so:

const MyPlugin = require('myplugin')

const addMyPlugin = config => {
  config.plugins.push(new MyPlugin())
  return config
}

module.exports = override(
  addMyPlugin,
  ...
)

@zhoucumt
Copy link

zhoucumt commented May 3, 2019

if I use like this:
module.exports = {
webpack: override(
// do sth
),
devServer: (configFunction) => {
}
};
how do I add uglifyjs-webpack-plugin?
@arackaf @bfischer1121

@with-heart
Copy link
Collaborator

@zhoucumt Were you able to answer your own question?

@with-heart with-heart added the ❓ question Further information is requested label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants