-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.config.js
50 lines (48 loc) · 1.09 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
import path from 'path';
import webpack from 'webpack';
import StaticSiteGeneratorPlugin from 'static-site-generator-webpack-plugin';
import autoprefixer from 'autoprefixer';
import data from './data';
export default {
entry: {
'main': './src/main.js'
},
output: {
path: __dirname+"/docs",
filename: 'bundle.js',
libraryTarget: 'umd'
},
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['es2015', 'react']
}
},
{
test: /\.jade$/,
loader: "jade-loader?self"
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loaders: [
'file?hash=sha512&digest=hex&name=[hash].[ext]',
'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
]
},
{
test: /\.styl$/,
loader: 'css-loader!stylus-loader!postcss-loader'
}
]
},
postcss: function () {
return [autoprefixer];
},
plugins: [
new StaticSiteGeneratorPlugin('main', data.routes(), data)
]
}