-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.doc.js
61 lines (61 loc) · 1.75 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
55
56
57
58
59
60
61
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");
module.exports = {
entry:{
index:"./doc/index"
},
output:{
path:"./build/",
filename:"[name].bundle.js"
},
module:{
loaders:[
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query:{
presets:['es2015','react']
}
},
{
test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css')
},
{
test: /\.(gif|png|jpg)$/,
loader: 'url-loader?limit=8192&name=img/[name].[ext]'
},
{
test: /\.(woff|svg|eot|ttf)\??.*/,
loader: 'url-loader?limit=8192&name=iconfont/[name].[ext]'
},
{
test:/\.demo\.html/,
loader:'file-loader?name=demo/[name].[ext]\?v=[hash]'
}
]
},
plugins:[
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"development"'
}),
new ExtractTextPlugin("styles.css"),
new HtmlWebpackPlugin({
template:"./test/template.html",
title:"输出测试",
filename:"index.html",
hash:true
})
],
resolve:{
extensions:['','.js','.jsx','.json'],
root: path.join(__dirname),
alias:{
'react':'react/dist/react.js',
'react-dom':'react-dom/dist/react-dom.js',
'jquery':'jquery/dist/jquery.js'
}
}
}