webpack/benchmark/createBenchmark/entry.js

28 lines
504 B
JavaScript
Raw Normal View History

2018-06-13 19:04:23 +08:00
// eslint-disable-next-line node/no-extraneous-require
const webpack = require("webpack");
const path = require("path");
const testCase = process.argv[2];
const config = {
context: __dirname,
entry: `./${testCase}`,
output: {
path: path.resolve(__dirname, "output-" + testCase)
},
devtool: process.argv[3]
};
const compiler = webpack(config);
compiler.run((err, stats) => {
2018-06-13 19:04:23 +08:00
if (err) {
console.error(err);
} else {
2018-06-13 19:04:23 +08:00
console.log(
stats.toString({
errorDetails: true
})
);
}
});