-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.chart.js
71 lines (68 loc) · 1.9 KB
/
webpack.config.chart.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
62
63
64
65
66
67
68
69
70
71
// new webpack.optimize.CommonsChunkPlugin('common.js');
/*
var uglifyJSPlugin = new webpack.optimize.UglifyJsPlugin({
compress: {
//supresses warnings, usually from module minification
warnings: false
}
}),
*/
// new webpack.NoErrorsPlugin()
/*
var HtmlWebpackPlugin = require('html-webpack-plugin');
https://www.npmjs.com/package/html-webpack-plugin
new webpack.HotModuleReplacementPlugin()
http://gaearon.github.io/react-hot-loader/getstarted/
*/
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:"./chart/test/index.js"
},
output:{
path:"./build/",
filename:"[name].bundle.js"
},
module:{
loaders:[
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel'
},
{
test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css')
}
]
},
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:{
'jquery':'jquery/dist/jquery.js',
'cad':path.resolve(__dirname,"src/"),
/* 'react':path.resolve(__dirname,"lib/preact"),
'react-dom':path.resolve(__dirname,"lib/preact")*/
}
}/*,
externals:{
'react':'React',
'react-dom':'ReactDOM',
"jquery":"jQuery"
}*/
}