-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
72 lines (70 loc) · 1.98 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
const NODE_ENV = process.env.NODE_ENV || 'development'
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: './app',
output: {
path: path.join(__dirname, 'public'),
publicPath: '/',
filename: 'index.js'
},
resolve: {
modulesDirectories: ['node_modules'],
extentions: ['', '.js']
},
resolveLoader: {
modulesDirectories: ['node_modules'],
extentions: ['', '.js'],
moduleTemplates: ["*-loader", "*"]
},
watch: NODE_ENV === 'development',
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV === 'development' ? 'cheep-inline-module-source-map' : null,
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015']
}
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.styl$/,
loader: ExtractTextPlugin.extract('css!stylus?linenos')
},
{
test: /\.pug$/,
exclude: /app\.pug$/,
loader: 'file?name=ng-tmpls/[hash].html!jade-html'
},
{
test: /\.(png|jpg|svg)(\?v=.+)?$/,
loader: 'file?name=img/[hash].[ext]'
},
{
test: /\.(ttf|woff2?|eot)(\?v=.+)?$/,
loader: 'file?name=font/[hash].[ext]'
}
]
},
plugins: [
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin('index.css'),
new HtmlWebpackPlugin({
template: 'pug?pretty!./app/app.pug'
})
],
externals: {
angular: true
}
};