-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.config.docs.js
42 lines (39 loc) · 1010 Bytes
/
webpack.config.docs.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
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
module.exports = (env, argv) => {
const bProduction = argv.mode
return {
entry: path.join(__dirname, './docs-src/js/index.js'),
output: {
filename: 'index-v0001.js',
path: path.join(__dirname, './docs'),
},
plugins: [
new HtmlWebpackPlugin({
template: path.join(__dirname, './docs-src/index.html'),
filename: path.join(__dirname, './docs/index.html'),
baseUrl: bProduction ? '/urpflanze/' : '/docs/',
}),
new webpack.DefinePlugin({
VERSION: JSON.stringify(require('./package.json').version),
}),
],
watchOptions: {
ignored: /node_modules/,
},
devtool: 'source-map',
mode: argv.mode || 'development',
watch: argv.watch,
devServer: {
openPage: '/docs',
contentBase: path.join(__dirname, '.'),
publicPath: '/docs',
watchContentBase: true,
host: '0.0.0.0',
hot: true,
hotOnly: true,
port: 8888,
},
}
}