webpack/benchmark/createBenchmark/entry.js

27 lines
448 B
JavaScript
Raw Normal View History

const webpack = require("../../");
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
})
);
}
});