ruffle/web/packages/extension/webpack.config.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

/* eslint-env node */
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const path = require("path");
2019-08-20 04:29:53 +00:00
module.exports = (env, argv) => {
let mode = "production";
if (argv && argv.mode) {
mode = argv.mode;
}
2019-08-20 04:29:53 +00:00
console.log(`Building ${mode}...`);
2019-08-20 04:29:53 +00:00
return {
entry: {
ruffle: path.resolve(__dirname, "js/index.js"),
popup: path.resolve(__dirname, "js/popup.js"),
2020-05-28 17:19:41 +00:00
settings: path.resolve(__dirname, "js/settings.js"),
lv0: path.resolve(__dirname, "js/lv0.js"),
},
output: {
publicPath: "",
path: path.resolve(__dirname, "build/dist"),
filename: "[name].js",
chunkFilename: "core.ruffle.js",
},
mode: mode,
2020-10-17 20:21:40 +00:00
experiments: {
syncWebAssembly: true,
},
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [{ from: "LICENSE*" }, { from: "README.md" }],
}),
],
};
2019-08-20 04:29:53 +00:00
};