-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
75 lines (70 loc) · 2.04 KB
/
Copy pathwebpack.dev.config.js
File metadata and controls
75 lines (70 loc) · 2.04 KB
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
72
73
74
75
/* global __dirname */
var path = require('path');
var webpack = require('webpack');
//var CopyWebpackPlugin = require('copy-webpack-plugin');
var dir_js = path.resolve(__dirname, 'js');
var dir_html = path.resolve(__dirname, 'html');
var dir_build = path.resolve(__dirname, 'build');
module.exports = {
/* entry: [
'webpack-dev-server/client?http://localhost:8090',
'webpack/hot/dev-server',
path.resolve(dir_js, 'index.js')
],*/
entry:{
citrus:['webpack-dev-server/client?http://localhost:8090',
'webpack/hot/dev-server',
path.resolve(dir_js,'index.js')],
hostedFields:path.resolve(dir_js,'hosted-field-index.js')
},
output: {
path: dir_build,
//publicPath: '/release',
publicPath: '/jsv2/release',
filename: '[name].min.js'
},
devServer: {
//contentBase: dir_build,
proxy: {
"*": "http://localhost:3500"
},
hot: true,
port: '8090'
},
module: {
loaders: [
{
loader: 'babel-loader',
test: dir_js
}
]
},
plugins: [
/*// Simply copies the files over
new CopyWebpackPlugin([
{ from: dir_html } // to: output.path
]),
*/
// Avoid publishing files when compilation fails
new webpack.NoErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
/*http://webpack.github.io/docs/shimming-modules.html
new webpack.ProvidePlugin({
fetch: "whatwg-fetch",
"window.fetch": "whatwg-fetch"
})*/
//http://mts.io/2015/04/08/webpack-shims-polyfills/
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
// new webpack.optimize.UglifyJsPlugin({
// sourceMap: true
// })
],
stats: {
// Nice colored output
colors: true
},
// Create Sourcemaps for the bundle
devtool: 'source-map'
};