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

32 lines
843 B
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: path.resolve(__dirname, "js/index.js"),
output: {
path: path.resolve(__dirname, "build/dist"),
filename: "ruffle.js",
chunkFilename: "core.ruffle.js",
jsonpFunction: "RufflePlayerExtensionLoader",
},
mode: mode,
plugins: [
new CleanWebpackPlugin(),
new CopyPlugin({
patterns: [{ from: "LICENSE*" }, { from: "README.md" }],
}),
],
};
2019-08-20 04:29:53 +00:00
};