From eb31419a33adfb1770802c6dad2b73a0f1d5a98f Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Sat, 17 Oct 2020 12:31:21 +0200 Subject: [PATCH 1/2] Update template to webpack 5 --- template/package.json | 2 +- template/webpack.config.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/template/package.json b/template/package.json index 26c4708..da236f4 100644 --- a/template/package.json +++ b/template/package.json @@ -10,7 +10,7 @@ "devDependencies": { "@wasm-tool/wasm-pack-plugin": "^1.1.0", "copy-webpack-plugin": "^5.0.3", - "webpack": "^4.42.0", + "webpack": "^5.1.0", "webpack-cli": "^3.3.3", "webpack-dev-server": "^3.7.1", "rimraf": "^3.0.0" diff --git a/template/webpack.config.js b/template/webpack.config.js index d35da09..91967b3 100644 --- a/template/webpack.config.js +++ b/template/webpack.config.js @@ -16,6 +16,9 @@ module.exports = { devServer: { contentBase: dist, }, + experiments: { + asyncWebAssembly: true + }, plugins: [ new CopyPlugin([ path.resolve(__dirname, "static") From 8b65e3b8388ea7312691a9bff0923255b3b03095 Mon Sep 17 00:00:00 2001 From: Luke Pfeiffer Date: Wed, 23 Feb 2022 15:57:50 -0800 Subject: [PATCH 2/2] Updated more packages to support the webpack upgrade Fixed isses with the webpack config as the schema changed between versions --- template/package.json | 10 +++++----- template/webpack.config.js | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/template/package.json b/template/package.json index da236f4..5bd2efb 100644 --- a/template/package.json +++ b/template/package.json @@ -4,15 +4,15 @@ "version": "0.1.0", "scripts": { "build": "rimraf dist pkg && webpack", - "start": "rimraf dist pkg && webpack-dev-server --open -d", + "start": "rimraf dist pkg && webpack-dev-server --open", "test": "cargo test && wasm-pack test --headless" }, "devDependencies": { "@wasm-tool/wasm-pack-plugin": "^1.1.0", - "copy-webpack-plugin": "^5.0.3", + "copy-webpack-plugin": "^10.2.0", "webpack": "^5.1.0", - "webpack-cli": "^3.3.3", - "webpack-dev-server": "^3.7.1", + "webpack-cli": "^4.9.1", + "webpack-dev-server": "^4.7.2", "rimraf": "^3.0.0" } -} +} \ No newline at end of file diff --git a/template/webpack.config.js b/template/webpack.config.js index 91967b3..1e12c00 100644 --- a/template/webpack.config.js +++ b/template/webpack.config.js @@ -14,15 +14,19 @@ module.exports = { filename: "[name].js" }, devServer: { - contentBase: dist, + static: { + directory: dist + }, }, experiments: { asyncWebAssembly: true }, plugins: [ - new CopyPlugin([ - path.resolve(__dirname, "static") - ]), + new CopyPlugin({ + patterns: [ + path.resolve(__dirname, "static") + ] + }), new WasmPackPlugin({ crateDirectory: __dirname,