-
-
Notifications
You must be signed in to change notification settings - Fork 3.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 to Webpack 4 #1214
Upgrade to Webpack 4 #1214
Conversation
Deploy preview for netlify-cms-www ready! Built with commit 70b7fc3 |
Deploy preview for cms-demo ready! Built with commit 70b7fc3 |
85a7aa4
to
5455845
Compare
Ready for review! Tests needed (check em' off):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything else looked pretty good
webpack.dev.js
Outdated
library: 'netlify-cms', | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true, | ||
}, | ||
context: path.join(__dirname, 'src'), | ||
module: { | ||
noParse: /localforage\.js/, | ||
loaders: [ | ||
rules: [ | ||
{ | ||
loader: path.resolve(__dirname, './node_modules/babel-loader'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line does not resolve for me. Used:
loader: 'babel-loader',
reason I was testing against hoisting dependencies using yarn workspaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested using WebPack v3? Looking at the git blame, I think there was a reason it was set explicitly like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested it and the yarn start worked without an issue. I would not know what issue would be caused by that, because it is just a loader. I sure creates an issue if you are hoisting dependencies for yarn workspaces though 👅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack.prod.js
Outdated
'process.env': { | ||
NODE_ENV: JSON.stringify('production'), | ||
}, | ||
}), | ||
new webpack.DefinePlugin({ | ||
NETLIFY_CMS_VERSION: JSON.stringify(require("./package.json").version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dangling require has always bugged me 😀
There is one in webpack.dev.js
also
const packageData = require("./package.json");
then
NETLIFY_CMS_VERSION: JSON.stringify(packageData.version),
webpack.dev.js
to:
NETLIFY_CMS_VERSION: JSON.stringify(`${ packageData.version }-dev`),
webpack.dev.js
Outdated
devServer: { | ||
contentBase: 'example/', | ||
historyApiFallback: true, | ||
disableHostCheck: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped historyApiFallback
and disableHostCheck
, is there a reason they were needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added them back on the PR to this branch just submitted, we should test to see if we can get rid of them
Caleb, I changed this to WIP just as a reminder there is a PR #1313 against this branch, so you don't forget to merge it if you so choose. 😀
|
clean up unused scripts
@tech4him1 @Benaiah @erquhart Merged in the single |
@tech4him1 the only tests remaining are Windows and Linux. @talves are you on Windows? @Benaiah can you run a quick build on Linux? |
I already approved for Windows. Did not keep my check mark 😛. I have been building using this branch for weeks since I made the merged changes. |
Alright, I think Linux is probably okay right? Those guys like living on the edge anyway... |
- Summary
Changed Plugins:
migrated to webpack-serve(unstable for function configs)Access-Control
header -- doesn't seem necessary?Working Plugins:
- Test plan
Build commands to test:
build:scripts(removed)- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)