-
Notifications
You must be signed in to change notification settings - Fork 23
/
webpack.config.docs.static.js
41 lines (36 loc) · 1.03 KB
/
webpack.config.docs.static.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
'use strict'
let CleanPlugin = require('clean-webpack-plugin')
let StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin')
let StatsWriterPlugin = require('webpack-stats-plugin').StatsWriterPlugin
let DefinePlugin = require('webpack').DefinePlugin
let base = require('./webpack.config.dev.js')
let OUTPUT_DIR = 'docs/build'
// All routes we want to static-render--in this case, just the index page:
let routes = [
''
]
module.exports = {
entry: {
main: './docs/static-render-entry.js'
},
output: {
path: OUTPUT_DIR,
filename: 'main.[hash].js',
libraryTarget: 'umd' // Needs to be universal for `static-site-generator-webpack-plugin` to work
},
resolve: base.resolve,
module: base.module,
plugins: [
new CleanPlugin(OUTPUT_DIR),
new StatsWriterPlugin({
filename: 'stats.json'
}),
new DefinePlugin({
'process.env': {
// Disable warnings for static build
NODE_ENV: JSON.stringify('docs')
}
}),
new StaticSiteGeneratorPlugin('main', routes)
]
}