forked from David-Desmaisons/Vue.D3.tree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.doc.conf.js
50 lines (49 loc) · 1.64 KB
/
webpack.doc.conf.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
var config = require('../config')
var webpack = require('webpack')
var merge = require('webpack-merge')
var utils = require('./utils')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// add hot-reload related code to entry chunks
module.exports = merge(baseWebpackConfig, {
entry: {
tree: ['./build/dev-client'].concat('./example/tree/main.js'),
hierarchicalEdgeBundling: ['./build/dev-client'].concat('./example/hierarchicalEdgeBundling/main.js')
},
module: {
loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
output: {
path: config.doc.assetsRoot,
publicPath: config.doc.assetsPublicPath,
filename: "[name]_bundle.js"
},
// eval-source-map is faster for development
devtool: '#eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': config.dev.env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: '../docs/tree.html',
template: './example/tree/index.html',
chunks: ['tree'],
autoInject: true
}),
new HtmlWebpackPlugin({
filename: '../docs/hierarchicalEdgeBundling.html',
template: './example/hierarchicalEdgeBundling/index.html',
chunks: ['hierarchicalEdgeBundling'],
}),
new HtmlWebpackPlugin({
filename: '../docs/index.html',
template: './example/index.html',
chunks: [],
})
]
})