diff --git a/package.json b/package.json index d21d358..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", @@ -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..7eb1853 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,15 @@ 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, + }, };