From 0679aef36d7de85d2c3ca5d1f6cca00166d8eebf Mon Sep 17 00:00:00 2001 From: Daw-Chih Liou Date: Wed, 1 Mar 2023 08:00:50 +0100 Subject: [PATCH 1/3] feat: upgrade to webpack 5 --- package.json | 6 +++--- webpack.config.js | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index d21d358..90ae86e 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "homepage": "https://github.com/rustwasm/create-wasm-app#readme", "devDependencies": { "hello-wasm-pack": "^0.1.0", - "webpack": "^4.29.3", - "webpack-cli": "^3.1.0", - "webpack-dev-server": "^3.1.5", + "webpack": "^5.75.0", + "webpack-cli": "^5.0.1", + "webpack-dev-server": "^4.11.1", "copy-webpack-plugin": "^5.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index 80ad814..8de1137 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ const CopyWebpackPlugin = require("copy-webpack-plugin"); -const path = require('path'); +const path = require("path"); module.exports = { entry: "./bootstrap.js", @@ -8,7 +8,16 @@ module.exports = { filename: "bootstrap.js", }, mode: "development", - plugins: [ - new CopyWebpackPlugin(['index.html']) - ], + plugins: [new CopyWebpackPlugin(["index.html"])], + experiments: { + asyncWebAssembly: true, + syncWebAssembly: true, + }, + devServer: { + static: { + directory: path.join(__dirname, "dist"), + }, + compress: true, + port: 3000, + }, }; From f5bee535d53e419fbb5bad6cbf9bd5eb4b2b3720 Mon Sep 17 00:00:00 2001 From: Daw-Chih Liou Date: Wed, 1 Mar 2023 08:02:07 +0100 Subject: [PATCH 2/3] reactor: remove dev server port configuration --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 8de1137..7eb1853 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -18,6 +18,5 @@ module.exports = { directory: path.join(__dirname, "dist"), }, compress: true, - port: 3000, }, }; From 83718929ce36a732f59bbd86d32226897c46fd43 Mon Sep 17 00:00:00 2001 From: Daw-Chih Liou Date: Wed, 1 Mar 2023 08:11:33 +0100 Subject: [PATCH 3/3] refactor: update start script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 90ae86e..c2daac8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "build": "webpack --config webpack.config.js", - "start": "webpack-dev-server" + "start": "webpack serve" }, "repository": { "type": "git",