mirror of
https://github.com/tornadocash/phase2-wasm.git
synced 2024-11-25 19:36:01 +01:00
32 lines
742 B
JavaScript
32 lines
742 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"
|
||
|
},
|
||
|
devServer: {
|
||
|
contentBase: dist,
|
||
|
},
|
||
|
plugins: [
|
||
|
new CopyPlugin([
|
||
|
path.resolve(__dirname, "static")
|
||
|
]),
|
||
|
|
||
|
new WasmPackPlugin({
|
||
|
crateDirectory: path.resolve(__dirname, 'phase2-bn254', 'phase2'),
|
||
|
outDir: path.resolve(__dirname, "pkg"),
|
||
|
extraArgs: "--target browser --mode normal -- --no-default-features --features wasm",
|
||
|
forceMode: "production"
|
||
|
}),
|
||
|
]
|
||
|
};
|