forked from SOCR/SOCRAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.coffee
108 lines (95 loc) · 2.26 KB
/
webpack.config.coffee
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
webpack = require 'webpack'
production = process.env.NODE_ENV is 'production'
appRoot = "#{__dirname}/app"
module.exports =
cache: true
debug: !production
devtool: production ? false : 'eval'
# The entry point
entry: [
"#{appRoot}/app.coffee"
]
output:
path: './_build'
filename: 'socrat.js'
chunkFilename: "[id].socrat.js"
devServer: {
hot: true,
}
module:
loaders: [
test: /\.jsx?$/
exclude: /(node_modules|bower_components)/
loader: 'babel'
,
test: /\.less$/
loader: 'style!css!less'
,
test: /\.css$/
loader: 'style!css'
,
test: /\.coffee$/
loader: 'coffee'
,
test: /\.jade$/
loader: 'jade-loader'
,
test: /\.html$/,
loader: 'html'
,
# required for bootstrap icons
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/
loader: "file"
,
test: /\.(woff|woff2)$/
loader: 'url?prefix=font/&limit=5000&mimetype=application/font-woff'
,
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/
loader: "url?limit=10000&mimetype=application/octet-stream"
,
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/
loader: "url?limit=10000&mimetype=image/svg+xml"
,
test: /\.jpe?g$|\.gif$|\.png$/i
loader: "url"
,
test: /[\/]datavore-d0\.1\.js$/
loader: 'exports?dv'
,
test: /[\/]highlight\.js$/
loader: 'exports?Highlight'
,
test: /[\/]dw\.js$/
loader: 'imports?dv=datavore!imports?Highlight=highlight!exports?dw'
,
test: /[\/]flat-ui\.js$/
loader: 'imports?this=>window'
,
test: require.resolve('vega'),
loaders: [
'transform?vega/scripts/strip-schema.js',
'transform?browserify-versionify'
]
]
resolve:
extensions: [
''
'.js'
'.coffee'
'.less'
'.css'
]
root: appRoot
alias:
datavore: 'data-wrangler/lib/datavore/datavore-d0.1.js'
highlight: 'data-wrangler/lib/Highlight/highlight.js'
'jquery-ui': 'jquery-ui/ui/widgets'
'vega-lite': 'vega-lite/vega-lite.js'
plugins: [
# disable dynamic requires
new webpack.ContextReplacementPlugin /.*$/, /a^/
new webpack.ProvidePlugin
$: "jquery",
jQuery: "jquery",
'window.jQuery': "jquery"
]