-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 extend webpack config? #1308
Comments
Hi @c0b You can get all the configuration to the project itself by running And then you are free to edit the webpack configurations |
We don't currently transpile dependencies. This is intentional because otherwise build times would be slower. It has long been a convention to precompile packages to ES5 before publishing to npm, and CRA only works well with such packages. There is a discussions about this in #1125. No, there are no currently no plans to make Webpack configuration configurable before ejecting. This hurts our ability to change things internally as people come to depend on specific versions of Webpack, loaders, etc. This also has been discussed before so I encourage you to use issue search before creating a new issue: #99 #145 #460 #481 #1060 #1103 #1111. If these limitations don't work for you, indeed I recommend checking out alternatives like nwb and kyt which provide these features. I hope this helps! |
@c0b import transpiled ES5 files. Instead import { MDCSnackbar } from '@material/snackbar' use import { MDCSnackbar } from '@material/snackbar/dist/mdc.snackbar.js' |
@c0b The underlying concept is same as what "react-app-rewired" did but you are able to re-publish it like your version of react-scripts which "react-app-rewired" not allow you to do so. You are allowed to rewire the env, paths, webpack.config.dev, webpack.config.prod, webpackDevServer.config and createJestConfig yourself. I am still a newbie on open source community, looking for feedback on this approach. |
FYI, we're starting the work to compile deps with Let us know if you have feedback about how this should work. |
I'm using this
create-react-app
to start a new react project, want to use components frommaterial-components-web
; while a first problem met is the transpiled script containsimport and export
which browser doesn't understand, I guess it's because the builtin webpack.config has an exclusion of all code under^node_modules/
, it transpiles only user's app code; is this true?https://github.com/material-components/material-components-web#javascript
I tested the similar
NYTimes/kyt
project, that exposes amodifywebpackconfig
interface for users to easily tweak webpack config somewhat; wonder if this create-react-app has some similar easy way of webpack customization? I feel like theeject
to make copies of all builtin webpack config stuff is the only option here?https://github.com/NYTimes/kyt/blob/master/docs/kytConfig.md#modifywebpackconfig
The text was updated successfully, but these errors were encountered: