-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
79 lines (76 loc) · 2.28 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var path = require("path"),
webpack = require("webpack"),
ExtractTextPlugin = require("extract-text-webpack-plugin"),
ManifestRevisionPlugin = require("manifest-revision-webpack-plugin"),
CleanWebpackPlugin = require('clean-webpack-plugin');
var root = "./assets";
module.exports = {
entry: {
app_js: [
root + "/scripts/app.js"
],
app_css: [
root + "/styles/style.less"
],
vendor_js: [
'./node_modules/angular/angular.js',
'./node_modules/angular-ui-bootstrap/dist/ui-bootstrap.js',
'./node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js'
]
},
output: {
path: "./feature_request/build/public",
publicPath: "/assets/",
filename: "[name].js",
chunkFilename: "[id].chunk"
},
resolve: {
extensions: ["", ".js", ".less"]
},
module: {
preLoaders: [
{
test: /\.js$/,
exclude: [
/node_modules/,
/\.spec\.js$/
],
loader: 'isparta-loader'
}
],
loaders: [
{
test: /\.js$/i,
exclude: /(node_modules|assets\/styles)/,
loader: "ng-annotate!babel"
},
{
test: /\.less$/i,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('css!less')
},
{
test: /\.html$/,
loader: 'ngtemplate?relativeTo=' + (path.resolve(__dirname, './assets/scripts')) + '/!html'
},
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}
]
},
plugins: [
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin("[name].css"),
new ManifestRevisionPlugin(path.join("feature_request", "build", "manifest.json"), {
rootAssetPath: root,
ignorePaths: ["/styles", "/scripts"]
}),
new webpack.optimize.DedupePlugin(),
new webpack.DefinePlugin({
"process.env": {
NODE_ENV: '"production"'
}
})
],
devtool: "inline-source-map"
};