You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
630 B
JavaScript
27 lines
630 B
JavaScript
const WasmPackPlugin = require('@wasm-tool/wasm-pack-plugin');
|
|
const path = require('path');
|
|
|
|
let loadedWasm = false;
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const nextConfig = {
|
|
reactStrictMode: true,
|
|
webpack(nextConfig) {
|
|
if (!loadedWasm) {
|
|
loadedWasm = true;
|
|
nextConfig.plugins.push(
|
|
new WasmPackPlugin({
|
|
crateDirectory: path.resolve(__dirname, 'utfdump', 'wasm'),
|
|
outDir: path.resolve(__dirname, 'wasm', 'utfdump'),
|
|
forceMode: 'production',
|
|
extraArgs: '--target web',
|
|
})
|
|
);
|
|
}
|
|
|
|
return nextConfig;
|
|
},
|
|
};
|
|
|
|
module.exports = nextConfig;
|