-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
68 lines (67 loc) · 1.89 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
let path = require('path');
let fs = require('fs');
module.exports = {
entry: './public/app/app.es6',
debug: true,
output: {
publicPath: '/dist/',
filename: 'bundle.js',
path: './public/dist'
},
module: {
loaders: [
// {
// test: /\.js$/,
// enforce: "pre",
// exclude: /node_modules/,
// use: 'eslint-loader'
// },
{
test: /\.es6$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
},
{
test: /\.scss$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!sass-loader'
},
{
test: /\.css$/,
// exclude: /node_modules/,
loader: 'style-loader!css-loader'
},
{
test: /\.(png|jpg|gif)$/,
exclude: /node_modules/,
loader: 'url-loader?limit=10000'
},
{
test: /\.(otf|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
loader: 'file-loader'
},
{
test: /\.json$/,
exclude: /node_modules/,
loader: 'json-loader'
}
],
postLoaders: [{
test: /\.(js|es6)$/,
// test: /\.es6$/,
exclude: /node_modules/,
loader: 'ng-annotate'
}]
},
node: {
fs: 'empty' //Stub node's fs for client libraries (specifically, angular-router requires that)
},
devtool: process.env.NODE_ENV === 'dev' ? 'cheap-eval-source-map': '',
resolve: {
root: [path.resolve('./public')],
extensions: ['', '.js', '.es6', '.ts']
}
};