-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpackDev.config.babel.js
45 lines (42 loc) · 1.25 KB
/
webpackDev.config.babel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const webpack = require("webpack"),
path = require("path"),
config = require("./webpackBase.config.babel.js"),
entry = config.entry;
var nameFile, pathFile, Config;
for(var k in entry)
{
if(entry.hasOwnProperty(k) && k != 'YW')
{
nameFile = k;
pathFile = typeof(entry[k]) == 'object' ? entry[k][entry[k].length - 1] : entry[k];
}
}
console.log(nameFile, pathFile);
Config = {
output: { path: path.resolve(__dirname, './build/'), filename: 'buildBundle.js', publicPath: '../' },
module: {
loaders: config.module.loaders.concat(
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader'
}
)
},
postcss: config.postcss,
//简便设置
resolve: config.resolve,
// plugins: config.plugins.concat(
// new webpack.DefinePlugin({
// "process.env": {
// NODE_ENV: JSON.stringify("production")
// }
// })
// ),
plugins: config.plugins,
watch: !0,
cache: !0,
debug: !0,
}
Config.entry = {};
Config.entry[nameFile] = pathFile;
module.exports = Config;