forked from weui/react-weui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.doc.js
54 lines (53 loc) · 1.72 KB
/
webpack.config.doc.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
53
54
var webpack = require('webpack');
var path = require('path');
var autoprefixer = require('autoprefixer');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var OpenBrowserPlugin = require('open-browser-webpack-plugin');
module.exports = {
context: path.join(__dirname, 'docs'),
entry: {
js: ['babel-polyfill', './app.js'],
vendor: ['react', 'classnames', 'react-router', 'react-dom', 'react-addons-css-transition-group']
},
output: {
path: path.resolve(__dirname, 'dist/docs'),
filename: './bundle.js'
},
module: {
loaders:[
{
test: /\.js[x]?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
cacheDirectory: true,
}
}, {
test: /\.less$/,
loader: 'style!css!postcss!less'
}, {
test: /\.css/,
loader: ExtractTextPlugin.extract('style', 'css', 'postcss')
}, {
test: /\.(png|jpg|svg)$/,
loader: 'url?limit=25000'
},{
test: /\.json$/,
loader: 'json'
}
]
},
postcss: [autoprefixer],
plugins: [
new webpack.DefinePlugin({
DEBUG: process.env.NODE_ENV !== 'production'
}),
new ExtractTextPlugin('weui.min.css'),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js'),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'docs/index.html')
}),
//new OpenBrowserPlugin({ url: 'http://localhost:8080' })
]
};