2018-06-14 16:09:39 +08:00
|
|
|
const webpack = require("../../");
|
2017-06-23 20:56:02 +08:00
|
|
|
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) {
|
2017-06-23 20:56:02 +08:00
|
|
|
console.error(err);
|
|
|
|
} else {
|
2018-06-13 19:04:23 +08:00
|
|
|
console.log(
|
|
|
|
stats.toString({
|
|
|
|
errorDetails: true
|
|
|
|
})
|
|
|
|
);
|
2017-06-23 20:56:02 +08:00
|
|
|
}
|
|
|
|
});
|