TeaWeb/webpack-web.config.ts

28 lines
967 B
TypeScript
Raw Normal View History

import * as path from "path";
import * as config_base from "./webpack.config";
2020-09-01 12:43:04 +00:00
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
export = () => config_base.config("web").then(config => {
Object.assign(config.entry, {
"shared-app": "./web/app/index.ts",
"modal-external": "./web/app/index-external.ts"
});
Object.assign(config.resolve.alias, {
"tc-shared": path.resolve(__dirname, "shared/js"),
2020-09-01 12:39:35 +00:00
"tc-backend/audio-lib": path.resolve(__dirname, "web/audio-lib/pkg"),
"tc-backend/web": path.resolve(__dirname, "web/app"),
"tc-backend": path.resolve(__dirname, "web/app"),
});
config.node = config.node || {};
config.node["fs"] = "empty";
2020-09-01 12:43:04 +00:00
config.plugins.push(new WasmPackPlugin({
2020-09-01 10:53:42 +00:00
crateDirectory: path.resolve(__dirname, "web", "audio-lib"),
outName: "index",
//forceMode: "profiling",
2020-09-01 12:39:35 +00:00
outDir: "pkg"
}));
return Promise.resolve(config);
});