2021-06-03 20:21:09 +00:00
|
|
|
const path = require("path");
|
|
|
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
|
|
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
|
|
|
|
console.log('path:', path.resolve(__dirname, 'crate'));
|
|
|
|
module.exports = {
|
|
|
|
experiments: {
|
|
|
|
asyncWebAssembly: true
|
|
|
|
},
|
|
|
|
entry: './index.js',
|
|
|
|
mode: "development",
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, './dist'),
|
|
|
|
filename: 'index_bundle.js',
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin(),
|
2021-06-07 22:40:47 +00:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
title: 'Tenebrous'
|
|
|
|
}),
|
2021-06-03 20:21:09 +00:00
|
|
|
new WasmPackPlugin({
|
|
|
|
crateDirectory: path.resolve(__dirname, "crate"),
|
|
|
|
outDir: path.resolve(__dirname, "pkg"),
|
|
|
|
args: "--log-level warn",
|
|
|
|
extraArgs: "--no-typescript",
|
|
|
|
})
|
|
|
|
]
|
|
|
|
};
|