-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathwebpack.config.js
64 lines (62 loc) · 2.02 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
var path = require('path'),
webpack = require('webpack');
var autoprefixerOptions = {
browsers: [
'last 2 versions',
'iOS >= 7',
'Android >= 4',
'Explorer >= 10',
'ExplorerMobile >= 11'
],
cascade: false
};
module.exports = {
devtool: 'source-map', // for faster builds use 'eval'
debug: true, // remove in production
entry: {
'app': [
// For hot style updates
'webpack/hot/dev-server',
// The script refreshing the browser on none hot updates
'webpack-dev-server/client?http://localhost:3001',
path.join(__dirname, 'public', 'app', 'bootstrap.js')
],
'vendor': path.join(__dirname, 'public', 'app', 'vendor.js')
},
output: {
path: path.join(__dirname, 'public', 'bundle'),
filename: '[name].js'
},
module: {
preLoaders: [
{test: /\.js$/, loader: 'eslint-loader', exclude: /node_modules/}
],
loaders: [
{test: /\.css/, loader: 'css'},
{test: /\.html$/, loader: 'raw'},
{test: /\.js$/, loader: 'babel', exclude: /(node_modules|.spec.js)/},
{test: /\.scss$/, loaders: ['style', 'css', 'autoprefixer?' + JSON.stringify(autoprefixerOptions), 'sass']},
{test: /\.(png|woff|ttf|svg)(\?.*)?$/, loader: 'url-loader?limit=1000000'}
],
noParse: [/.+zone\.js\/dist\/.+/, /.+angular2\/bundles\/.+/, /.+zone\.js\/lib\/.+/]
},
resolve: {
modulesDirectories: [
'node_modules'
],
extensions: ['', '.js']
},
// Sass loader configuration to tell webpack where to find the additional SASS files
// https://github.com/jtangelder/sass-loader#sass-options
sassLoader: {
includePaths: [
path.resolve(__dirname, 'node_modules', 'dist', 'src', 'scss')
]
},
eslint: {
formatter: require('eslint-friendly-formatter')
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};