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

client/weberver/site: upgrade to webpack 5 #990

Merged
merged 2 commits into from Mar 15, 2021

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Feb 27, 2021

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:

This also uses github action's actions/setup-node@v2.

@chappjc chappjc marked this pull request as ready for review March 3, 2021 01:21
@chappjc chappjc added this to the 0.2 milestone Mar 3, 2021
Copy link
Member

@JoeGruffins JoeGruffins left a 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.

@chappjc
Copy link
Member Author

chappjc commented Mar 3, 2021

@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",
Copy link
Member

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.

Copy link
Member Author

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).

Copy link
Member Author

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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer compatible?

Copy link
Member Author

@chappjc chappjc Mar 10, 2021

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.

chappjc and others added 2 commits March 11, 2021 10:39
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants