All important runner changes have landed upstream. Bug: 358290763 Change-Id: Ib47f6838618e9c0081f60f3b60d52b1ce149b2af Reviewed-on: https://chromium-review.googlesource.com/c/external/github.com/WebKit/JetStream/+/7094856 Reviewed-by: Marja Hölttä <marja@chromium.org>
42 lines
1 KiB
JavaScript
42 lines
1 KiB
JavaScript
import path from "path";
|
|
import { fileURLToPath } from "url";
|
|
import UnicodeEscapePlugin from "@dapplets/unicode-escape-webpack-plugin";
|
|
import { LicenseWebpackPlugin } from "license-webpack-plugin";
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
function config({ filename, minify }) {
|
|
return {
|
|
entry: "./src/test.mjs",
|
|
mode: "production",
|
|
devtool: "source-map",
|
|
target: "web",
|
|
output: {
|
|
path: path.resolve(__dirname, "dist"),
|
|
filename: filename,
|
|
library: {
|
|
name: "ValidatorJSBenchmark",
|
|
type: "globalThis",
|
|
},
|
|
libraryTarget: "assign",
|
|
chunkFormat: "commonjs",
|
|
},
|
|
plugins: [
|
|
new UnicodeEscapePlugin(),
|
|
new LicenseWebpackPlugin({
|
|
perChunkOutput: true,
|
|
outputFilename: "LICENSE.txt",
|
|
})
|
|
],
|
|
optimization: {
|
|
minimize: minify,
|
|
},
|
|
};
|
|
}
|
|
|
|
export default [
|
|
config({ filename: "bundle.es6.min.js", minify: true }),
|
|
config({ filename: "bundle.es6.js", minify: false }),
|
|
];
|