-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
61 lines (52 loc) · 1.1 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
var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
entry: {
app: './src/app'
},
output: {
path: path.join(process.cwd(), 'build/static'),
filename: '[name].js',
chunkFilename: '[id].chunk.js',
publicPath: '/static/'
},
module: {
loaders: [
{ test: /\.es6$/, exclude: /node_modules/, loader: 'babel' },
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css!sass')
}
]
},
resolve: {
extensions: ['', '.es6', '.webpack.js', '.web.js', '.js', '.html']
},
plugins: [
new ExtractTextPlugin('main.css', {
allChunks: true
}),
new HtmlWebpackPlugin({
hash: true,
minify: true,
data: {
some: 'value'
},
filename: '../some-template.html',
template: './src/some-template.html'
}),
new HtmlWebpackPlugin({
hash: true,
minify: true,
data: {
some: 'value'
},
filename: '../index.html',
template: './src/index.html'
})
]
};