Add webpack

This commit is contained in:
Alex Page 2022-02-04 19:41:43 -05:00
parent ecd7c87e29
commit f08691a62e
10 changed files with 5421 additions and 43 deletions

28
webpack.config.js Normal file
View file

@ -0,0 +1,28 @@
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"
},
devServer: {
contentBase: dist,
},
plugins: [
new CopyPlugin([
path.resolve(__dirname, "static")
]),
new WasmPackPlugin({
crateDirectory: __dirname,
}),
]
};