Peter Cai
c91d152d65
The generated script from wrangler keeps re-instantiating the WASM module every time the request is processed. Instead, let's switch to using the much, much better Webpack support for WASM.
12 lines
236 B
JavaScript
12 lines
236 B
JavaScript
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
|
|
|
module.exports = {
|
|
target: "webworker",
|
|
entry: "./worker.js",
|
|
mode: "production",
|
|
plugins: [
|
|
new WasmPackPlugin({
|
|
crateDirectory: __dirname,
|
|
})
|
|
]
|
|
}; |