This repository was archived by the owner on Jan 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathwebpack.config.js
More file actions
56 lines (54 loc) · 1.43 KB
/
webpack.config.js
File metadata and controls
56 lines (54 loc) · 1.43 KB
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
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: [
'./vendor/angular.src.js',
'./node_modules/angular-route/angular-route.js',
'./src/app.js'
]
},
output: {
filename: '[name].js',
path: './dest',
chunkFilename: '[id].chunk.js'
},
module: {
loaders: [
{test: /\.js$/, loader: 'babel', include: path.resolve('src')},
{test: /\.css$/, loader: ExtractTextPlugin.extract('style', 'css?sourceMap')},
{
test: /\.sass$/,
loader: ExtractTextPlugin
.extract('style', 'css?sourceMap!sass?sourceMap&indentedSyntax=true')
},
{test: /\.(png|jpg)$/, loader: 'url?limit=32768'},
{test: /\.html$/, loader: 'ng-cache?prefix=[dir]/[dir]'},
{test: /\.haml$/, loader: 'hamlc-loader'}
],
preLoaders: [{test: /\.js$/, loader: 'eslint', include: path.resolve('src')}],
noParse: [
/angular\.src\.js/
]
},
plugins: [
new ExtractTextPlugin('style.css', {allChunks: true}),
new HtmlWebpackPlugin({
template: path.resolve('src', 'index.html'),
inject: 'body'
})
],
devtool: 'eval-source-map',
devServer: {
historyApiFallback: true,
stats: {
chunkModules: false,
colors: true
},
contentBase: './src'
},
eslint: {
configFile: 'src/.eslintrc'
}
};