Update wasm-beep to webpack 5 (#684)

This commit is contained in:
Dan Wilhelm 2022-11-04 14:18:31 -07:00 • committed by GitHub
parent 7e17373e31
commit a9b34ea8bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5561 additions and 4772 deletions

File diff suppressed because it is too large Load diff

View file

@ -4,18 +4,18 @@
"version": "0.1.0", "version": "0.1.0",
"scripts": { "scripts": {
"build": "rimraf dist pkg && webpack", "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" "test": "cargo test && wasm-pack test --headless"
}, },
"devDependencies": { "devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^0.4.2", "@wasm-tool/wasm-pack-plugin": "^1.6.0",
"copy-webpack-plugin": "^5.0.3", "copy-webpack-plugin": "^11.0.0",
"webpack": "^4.33.0", "webpack": "^5.73.0",
"webpack-cli": "^3.3.3", "webpack-cli": "^4.10.0",
"webpack-dev-server": "^3.7.1", "webpack-dev-server": "^4.9.3",
"rimraf": "^2.6.3" "rimraf": "^3.0.2"
}, },
"dependencies": { "dependencies": {
"html-webpack-plugin": "^3.2.0" "html-webpack-plugin": "^5.5.0"
} }
} }

View file

@ -14,8 +14,13 @@ module.exports = {
path: dist, path: dist,
filename: "[name].js" filename: "[name].js"
}, },
experiments: {
syncWebAssembly: true
},
devServer: { devServer: {
contentBase: dist, static: {
directory: dist
},
}, },
plugins: [ plugins: [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
@ -23,7 +28,7 @@ module.exports = {
}), }),
new WasmPackPlugin({ new WasmPackPlugin({
crateDirectory: __dirname, crateDirectory: __dirname,
extraArgs: "--out-name index" outName: "index"
}), }),
] ]
}; };