ruffle/web/extension/webpack.config.js

31 lines
742 B
JavaScript
Raw Normal View History

2019-08-20 04:29:53 +00:00
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const webpack = require('webpack');
const path = require('path');
module.exports = (env, argv) => {
let mode = "development";
if (argv && argv.mode) {
mode = argv.mode;
}
console.log(`Building ${mode}...`);
return {
entry: path.resolve(__dirname, "js/bootstrap.js"),
2019-08-20 04:29:53 +00:00
output: {
path: path.resolve(__dirname, "dist"),
filename: "ruffle.js",
2019-08-20 04:29:53 +00:00
},
mode: mode,
plugins: [
new CleanWebpackPlugin(),
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, ".."),
extraArgs: "--out-name=ruffle",
forceMode: mode,
})
]
}
};