-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwebpack.dev.js
More file actions
112 lines (108 loc) · 2.63 KB
/
webpack.dev.js
File metadata and controls
112 lines (108 loc) · 2.63 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
var webpack = require('webpack')
var path = require('path')
var HtmlWebpackPlugin = require('html-webpack-plugin');
function isExternal(module) {
var userRequest = module.userRequest;
if (typeof userRequest !== 'string') {
return false;
}
return userRequest.indexOf('bower_components') >= 0 ||
userRequest.indexOf('node_modules') >= 0 ||
userRequest.indexOf('libraries') >= 0;
}
module.exports = {
cache: true,
context: path.join(__dirname, ''),
devtool: 'eval',
entry: ['./static/js/index.js'],
resolve: {
alias: {
'webworkify': 'webworkify-webpack',
'sinon': 'sinon/pkg/sinon'
}
},
node:{
"child_process": "empty"
},
module: {
noParse: [
/node_modules\/sinon\//
],
loaders: [
{
test: /\.hbs$/,
loader: 'handlebars-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
}, {
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
include: path.resolve('node_modules/mapbox-gl-shaders/index.js'),
loader: 'transform/cacheable?brfs'
},
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
include: [
path.join(__dirname, 'static', 'js')
],
query: {
cacheDirectory: true,
presets: ['react', 'es2015', 'stage-0'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy']
}
},
{
test: /\.styl$/,
loader: 'style-loader!css-loader!stylus-loader'
},
{
test: /\.(eot|svg|ttf|otf|woff|woff2)$/,
loader: 'file?name=fonts/[name].[ext]'
}
],
postLoaders: [
{
include: /node_modules\/mapbox-gl-shaders/,
loader: 'transform',
query: 'brfs'
}
]
},
devServer: {
host: '0.0.0.0',
proxy: {
'/api/v1/*': 'http://localhost:3000'
},
historyApiFallback: true
},
output: {
path: path.join(__dirname),
filename: '[name].[hash].js'
},
stylus: {
use: [require('nib')()],
import: ['~nib/lib/nib/index.styl']
},
plugins: [
new webpack.DllReferencePlugin({
context: path.join(__dirname),
manifest: require('./dll/vendor-manifest.json')
}),
// new webpack.optimize.CommonsChunkPlugin({
// name: 'vendors',
// minChunks: function(module) {
// return isExternal(module);
// }
// }),
new HtmlWebpackPlugin({
'title': 'INTO THE OKAVANGO',
'filename': 'index.html',
'template': 'templates/index.hbs',
'hash': true
})
]
}