forked from arnoldczhang/main-test2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
67 lines (66 loc) · 1.78 KB
/
webpack.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
57
58
59
60
61
62
63
64
65
66
67
var webpack = require('webpack');
var fs = require('fs');
/*************webpack config****************/
module.exports = {
// watch: true,
//页面入口
entry: {
'main-test2' : './resources/main-test2.js'
// "test": "./test/test.js",
// "singleTest": "./test/singleTest.js"
},
//出口文件输出配置
output: {
path: "./resources",
filename: '[name].min.js'
},
//source map 支持
devtool: '',
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.DedupePlugin()
],
//加载器
module: {
preLoaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader?presets[]=es2015'
}],
loaders: [{
test: /\.sass$/,
loader: 'style!css!sass'
}, {
test: /\.scss$/,
loader: 'style!css!sass'
}, {
test: /\.styl$/,
loader: "style!css!stylus"
}, {
test: /\.css$/,
loader: "style-loader!css-loader!less-loader"
}, {
test: /\.html$/,
loader: "html"
}, {
test: /\.txt$/,
loader: "raw"
}, {
test: /\.less$/,
loader: 'style-loader!css-loader!less-loader'
}, {
test: /.*\.(png|jpg|jpe?g|ico|gif|svg)$/i,
loaders: [
'image-webpack?{progressive:true, optimizationLevel: 3, interlaced: false, pngquant:{quality: "65-90", speed: 4}}',
'url-loader?limit=8192&name=images/[hash:8].[name].[ext]'
]
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
}
}