-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
62 lines (58 loc) · 1.79 KB
/
webpack.config.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
module.exports = function(env) {
var path = require('path');
var webpack = require("webpack");
var webpackModules = require("./webpack")(env);
var dependency = require("./app/dependency");
var appEnv = webpackModules.appEnv;
var rules = webpackModules.rules;
var plugins = webpackModules.plugins;
var webpackConfig = {
context: path.resolve('app'),
entry: {
jquery: dependency.jquery,
bootstrap: dependency.bootstrap,
angular: dependency.angular,
angularDependency: dependency.angularDependency,
vendors: dependency.vendors,
app: './app'
},
output: {
path: path.resolve('build'),
filename: '[hash][id].js',
chunkFilename: '[name][chunkhash][id].js',
publicPath: appEnv.publicPath
},
devtool: "#eval",
devServer: {
port: 9876,
contentBase: 'app'
},
module: {
rules: rules
},
plugins: plugins,
resolve: {
modules: ['node_modules'],
extensions: ['.js'],
alias: {
assets: path.resolve("app/assets"),
style: path.join(__dirname, "app/assets/less"),
components: path.resolve("app/components"),
services: path.resolve("app/components/common-services"),
env: path.resolve("app/env")
}
},
resolveLoader: {
moduleExtensions: ["-loader"]
},
performance: {
hints: false
},
target: 'web'
};
if (appEnv.environment == 'pro') {
delete webpackConfig['devtool'];
delete webpackConfig.output['publicPath'];
}
return webpackConfig;
}