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
client/weberver/site: upgrade to webpack 5 #990
Conversation
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.
Builds fine and nothing seems to have changed when using web.
@JoeGruffins And no python2 required anymore! May node-sass and node-gyp rest in peace. |
"version": "1.0.0", | ||
"description": "", | ||
"version": "1.1.0", | ||
"description": "dexc browser frontend", | ||
"private": true, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"watch": "webpack --watch --config webpack/dev.js", |
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.
npm run watch
is broken for me.
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.
Whoops. I swear I tested run watch
, must have been before I added the path
change as per the webpack 5 migration guide.
Just as well because apparently with npm v7 there's a new package-lock.json format (backward compatible with v6 but still updates the lock file every time).
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.
Damn that npm v7 change now makes this a net ++ PR instead of --.
const { CleanWebpackPlugin } = require('clean-webpack-plugin') | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | ||
const StyleLintPlugin = require('stylelint-webpack-plugin') | ||
const GitRevisionPlugin = require('git-revision-webpack-plugin') |
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.
No longer compatible?
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.
Semi-broken. pirelenito/git-revision-webpack-plugin#56
No repo activity since april and the pr has been there since october, so I don't expect much from the project in terms of updates. Figure we should cut out such deps if possible.
node-sass -> dart sass remove style-loader actions/setup-node@v2 replace babel-eslint with @babel/eslint-parser, bump webpack-dev-server babel-eslint functionality was moved into babel monorepo: @babel/eslint-parser webpack-dev-server v3 has all kinds of outdated deps, update to v4 beta use child_process instead of git-revision-webpack-plugin Call git directly with child_process. Use EnvironmentPlugin instead of DefinePlugin. This is shorthand for using the DefinePlugin on process.env keys, and it automatically performs JSON.stringify, and there is no "globals" required in eslintrc. https://webpack.js.org/plugins/environment-plugin/#use-case-git-version
I finally got tired of node-gyp and node-sass taking forever with a clean-install, and updated everything.
This updates webpack to v5 and a number of other major node module updates:
child_process
to callgit rev-parse
directly, pluswebpack.EnvironmentPlugin
to put the hash into app.js asprocess.env.COMMITHASH
This also uses github action's actions/setup-node@v2.