forked from baukh789/GridManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-dev-config.js
57 lines (56 loc) · 1.37 KB
/
webpack-dev-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
var webpack = require('webpack');
var path = require('path');
var TransferWebpackPlugin = require('transfer-webpack-plugin');
var buildPath = path.resolve(__dirname, "build");
var config = {
//入口文件配置
entry:path.resolve(__dirname, 'src/js/GridManager.js'),
resolve:{
extentions:["","js"]//当requrie的模块找不到时,添加这些后缀
},
//文件导出的配置
output:{
path: buildPath ,
filename: "js/GridManager.js",
publicPath: "/"
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
// mangle: false,
minimize: true,
warnings: false
}),
new TransferWebpackPlugin([
{from: __dirname + '/src/fonts', to: '/fonts'},
{from: __dirname + '/src/css', to: '/css'},
{from: __dirname + '/src/demo', to: '/demo'},
{from: __dirname + '/version', to: '/version'}
])
],
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
loader: 'eslint-loader',
include: [path.resolve(__dirname, "src/app")],
exclude: /(node_modules|bower_components)/
}
],
loaders: [
{
test: /\.js?$/,
loaders: ['babel?{"presets":["es2015"]}'],
exclude: /(node_modules|bower_components)/,
include: [path.join(__dirname, 'src')]
},
{
test:/\.css$/,
loader:'style!css',
exclude: /(node_modules|bower_components)/,
include: [path.join(__dirname, 'src')]
}
]
}
};
module.exports = config;