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

47 lines
1.1 KiB
JavaScript
Raw Normal View History

/* eslint-env node */
const path = require("path");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = (env, argv) => {
let mode = "production";
if (argv && argv.mode) {
mode = argv.mode;
}
console.log(`Building ${mode}...`);
return {
mode,
entry: "./www/index.js",
output: {
path: path.resolve(__dirname, "dist"),
filename: "index.js",
publicPath: "",
clean: true,
},
module: {
rules: [
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
{
test: /\.wasm$/i,
type: "asset/resource",
},
],
},
devtool: "source-map",
plugins: [
new CopyPlugin({
patterns: [
2021-02-21 20:52:04 +00:00
{ from: path.resolve(__dirname, "www/index.html") },
{ from: "LICENSE*" },
{ from: "README.md" },
],
}),
],
};
};