forked from rsuite/rsuite-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.docs.config.js
52 lines (45 loc) · 1.24 KB
/
webpack.docs.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
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const isPublish = process.env.NODE_ENV === 'publish';
const plugins = [
new ExtractTextPlugin('[name].css')
];
if (isPublish) {
plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}));
plugins.push(new webpack.BannerPlugin(`Last update: ${new Date().toString()}`));
plugins.push(new webpack.optimize.CommonsChunkPlugin({
names: ['data','vendor']
}));
}
module.exports = {
entry: {
index: path.join(__dirname, 'docs'),
data:['faker'],
vendor: ['react', 'react-dom', 'lodash', 'classnames', 'dom-lib']
},
output: {
path: path.join(__dirname, 'docs/assets'),
filename: '[name].js',
},
plugins: plugins,
module: {
loaders: [
{
test: /\.js$/,
loaders: [
'babel?babelrc'
],
exclude: /node_modules/
},
{
test:/\.less$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader')
}
]
}
};