Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16
v18
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "7.3.1",
"description": "A simple dapp used in MetaMask e2e tests.",
"engines": {
"node": ">= 16.0.0"
"node": ">= 18.0.0"
},
"scripts": {
"setup": "yarn install && yarn allow-scripts",
Expand Down Expand Up @@ -34,7 +34,6 @@
"url": "https://github.com/MetaMask/test-dapp/issues"
},
"homepage": "https://metamask.github.io/test-dapp",
"dependencies": {},
"devDependencies": {
"@lavamoat/allow-scripts": "^1.0.6",
"@metamask/auto-changelog": "^2.5.0",
Expand All @@ -43,8 +42,8 @@
"@metamask/onboarding": "^1.0.0",
"@openzeppelin/contracts": "4.9.3",
"base64-sol": "1.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.0.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
Expand All @@ -54,10 +53,11 @@
"ethereumjs-util": "^5.1.1",
"ethers": "^5.0.32",
"gh-pages": "^3.1.0",
"node-polyfill-webpack-plugin": "^2.0.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Webpack 4 had Node polyfills by default. For Webpack 5 you need to do it via a plugin.

"prettier": "^2.3.1",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.2"
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
},
"lavamoat": {
"allowScripts": {
Expand All @@ -67,5 +67,6 @@
"keccak": true,
"fsevents": true
}
}
},
"packageManager": "yarn@1.22.19"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to ensure that correct Yarn version is used for people with Yarn >=2 installed. Can be changed when we migrate this to Yarn 3/4.

}
16 changes: 13 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');

const DIST = path.resolve(__dirname, 'dist');

Expand All @@ -16,19 +17,28 @@ module.exports = {
publicPath: DIST,
},
devServer: {
contentBase: DIST,
client: {
// This hides the error / warning overlay.
overlay: false,
},
devMiddleware: {
writeToDisk: true,
},
static: {
directory: DIST,
},
port: 9011,
writeToDisk: true,
},
plugins: [
new NodePolyfillPlugin(),
new CleanWebpackPlugin({ cleanStaleWebpackAssets: false }),

// for build scripts
new CopyPlugin({
patterns: [
{
flatten: true,
from: './src/*',
to: '[name][ext]',
globOptions: {
ignore: ['**/*.js'],
},
Expand Down
Loading