-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Upgrade Webpack and related dependencies to v4.1.0 #2148
Conversation
Thank you @julienben !!!!! |
I've used this and it works great with this PR / webpack 4.1 And you can strip these lines from app entry point:
|
@DJTB The favicon too? How will it be included in the build without this line? @gretzky I just saw that I have a typo but I don't think it's worth opening a PR just for this. Could you fix it super quick? It's just that I wrote |
@julienben Isn't |
Hadn't heard of this before but the create-react-app team had the same conversation and stuck to |
@julienben the fix for the image loader is to change the options to this {cc @gretzky} {
test: /\.(jpg|png|gif|svg|ico)$/,
use: [
{
loader: 'file-loader',
options: {
name: 'assets/images/[hash].[ext]',
},
},
{
loader: 'image-webpack-loader',
// change to this, its that the way options are passed changed to this.
// options are examples btw
query: {
mozjpeg: {
progressive: true,
},
gifsicle: {
interlaced: false,
},
optipng: {
optimizationLevel: 7,
},
pngquant: {
quality: '65-90',
speed: 4,
},
},
},
],
}, I've never done a contrib so im a little lost and dont want to waste anyone's time by me doing it wrong :/ |
@julienben the pwa plugin also generates icons from a base large png (not the favicon .ico which still needs to be file-loader in index.html) although that appears to be on their roadmap.
Creates fingerprinted icons into build folder & manifest with:
|
Also worth noting that during my upgrade I had to lock |
Am I the only one experiencing a problem with webpack and shebang based on the current repository and your changes for webpack 4?
|
After this merge I am having problems with Webpack when running in development mode:
Microsoft Windows [Version 10.0.16299.309] Going back to before this merge all is fine. There are no problems with the production build. Any suggestions? I found the problem. It is related to webpack/webpack-dev-middleware#276 I will prepare a pull request. |
@Mensae you still have |
@csantiago132 Thanks for thinking with me. I found the problem, see my edited comment. At least it solves it for me. |
@Mensae ok sorry I think I didnt see it (or was edited after I posted) |
@csantiago132 Sorry, it was me :-) I saw your comment after I sent it. |
I just opened a new PR addressing (hopefully) everything that was discussed here. Check it out here.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Update Log
I did this for my own project so I thought I would make sure my work can benefit a project that has helped me a lot.
The upgrade process's main step was setting Webpack 4's
mode
appropriately. This triggers per-env defaults which match perfectly with the phased-out plugins I removed from the configs.Webpack 4 isn't very well documented yet. The best article I found is webpack 4: mode and optimization.
🗒️ Notes
import '!file-loader?name=[name].json!./manifest.notjson'
) so alternatives are welcome.injectReducer.js
andinjectSaga.js
. Not sure whyeslint
was seeing static methods from a class as undefined.options.optimization
was added mostly for easier customization in the future. What you see in theoptimization
part of the configs doesn't differ from the new Webpack defaults (per environment).Tooling Versions
📦 Version Diff
[0] PATCH UPDATES
[1] MINOR UPDATES
[3] MAJOR UPDATES
[4] NEW DEPENDENCIES
Errors Encountered
Warnings: Observed on
yarn install
after removing lockfile and node_modulesI believe all of these warnings were already there before this PR, except for the webpack-cli ones of course.