36 lines
731 B
JavaScript
36 lines
731 B
JavaScript
const path = require("path");
|
|
const CopyPlugin = require("copy-webpack-plugin");
|
|
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
|
|
|
const dist = path.resolve(__dirname, "dist");
|
|
|
|
module.exports = {
|
|
mode: "production",
|
|
entry: {
|
|
index: "./js/index.js"
|
|
},
|
|
output: {
|
|
path: dist,
|
|
filename: "[name].js"
|
|
},
|
|
experiments: {
|
|
asyncWebAssembly: true,
|
|
syncWebAssembly: true
|
|
},
|
|
devServer: {
|
|
static: {
|
|
directory: dist,
|
|
}
|
|
},
|
|
plugins: [
|
|
new CopyPlugin({
|
|
patterns: [
|
|
"static"
|
|
]
|
|
}),
|
|
|
|
new WasmPackPlugin({
|
|
crateDirectory: __dirname,
|
|
}),
|
|
]
|
|
};
|