2015-09-03 20:17:11 +08:00
|
|
|
var webpack = require("../../../");
|
2018-03-19 11:20:44 +08:00
|
|
|
var fs = require("fs");
|
|
|
|
|
var join = require("path").join;
|
|
|
|
|
|
|
|
|
|
function read(path) {
|
2018-07-12 23:12:00 +08:00
|
|
|
return JSON.stringify(
|
|
|
|
|
fs.readFileSync(join(__dirname, path), "utf8").replace(/\r\n?/g, "\n")
|
|
|
|
|
);
|
2018-03-19 11:20:44 +08:00
|
|
|
}
|
|
|
|
|
|
2015-09-03 20:17:11 +08:00
|
|
|
module.exports = [
|
|
|
|
|
{
|
2017-11-21 17:41:01 +08:00
|
|
|
mode: "production",
|
2015-09-03 20:17:11 +08:00
|
|
|
entry: "./index",
|
2019-11-05 17:04:01 +08:00
|
|
|
output: {
|
|
|
|
|
filename: "123.js"
|
|
|
|
|
},
|
2015-09-03 20:17:11 +08:00
|
|
|
plugins: [
|
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
|
VALUE: "123"
|
|
|
|
|
})
|
|
|
|
|
]
|
|
|
|
|
},
|
2018-01-19 16:21:00 +08:00
|
|
|
|
2015-09-03 20:17:11 +08:00
|
|
|
{
|
2017-11-21 17:41:01 +08:00
|
|
|
mode: "production",
|
2015-09-03 20:17:11 +08:00
|
|
|
entry: "./index",
|
2019-11-05 17:04:01 +08:00
|
|
|
output: {
|
|
|
|
|
filename: "321.js"
|
|
|
|
|
},
|
2015-09-03 20:17:11 +08:00
|
|
|
plugins: [
|
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
|
VALUE: "321"
|
|
|
|
|
})
|
|
|
|
|
]
|
2018-03-19 11:20:44 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
mode: "production",
|
|
|
|
|
entry: "./index",
|
2019-11-05 17:04:01 +08:00
|
|
|
output: {
|
|
|
|
|
filename: "both.js"
|
|
|
|
|
},
|
2018-03-19 11:20:44 +08:00
|
|
|
plugins: [
|
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
|
VALUE: webpack.DefinePlugin.runtimeValue(() => read("123.txt"), [
|
|
|
|
|
"./123.txt"
|
|
|
|
|
])
|
|
|
|
|
}),
|
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
|
VALUE: webpack.DefinePlugin.runtimeValue(() => read("321.txt"), [
|
|
|
|
|
"./321.txt"
|
|
|
|
|
])
|
|
|
|
|
})
|
|
|
|
|
]
|
2015-09-03 20:17:11 +08:00
|
|
|
}
|
|
|
|
|
];
|