-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathwebpack.poss.config.js
56 lines (53 loc) · 1.61 KB
/
webpack.poss.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
53
54
55
56
var path = require('path'),
webpack = require('webpack');
var config = {
cache:true,
devtool: 'eval', //or cheap-module-eval-source-map
entry: {
// index:['webpack/hot/dev-server', path.resolve(__dirname, 'Learn/examples/main.jsx')] 增删改查DEMO
index:['webpack/hot/dev-server', path.resolve(__dirname, 'Poss/main')]
},
// entry: ['webpack/hot/dev-server', path.resolve(__dirname, 'Learn/examples/main.jsx')],
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].bundle.js'
},
resolve:{
extensions:['','.js','.jsx']
},
plugins:[
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress:{
warnings : false
}
}),
new webpack.DllReferencePlugin({
context:__dirname,
manifest:require('./dist/vendor-manifest.json')
})
],
module: {
loaders: [{
test: /\.jsx?$/, // 用正则来匹配文件路径,这段意思是匹配 js 或者 jsx
loader: 'babel',
exclude:/node_modules/,
query: {
presets: ['react', 'es2015'],
plugins: ["transform-class-properties"],
cacheDirectory: true
},
include:__dirname
}, {
test: /\.less$/,
loader: 'style!css!less'
}, {
test: /\.(jpg|png)$/,
loader: 'url?limit=25000'
}],
plugins:['antd',{
style:'css'
}]
}
};
module.exports = config;