forked from Netflix/vizceral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (44 loc) · 1.16 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
/* eslint no-var:0 */
var webpack = require('webpack');
var yargs = require('yargs');
var options = yargs
.alias('p', 'optimize-minimize')
.alias('d', 'debug')
.argv;
var config = {
entry: './src/vizceral.js',
output: {
path: './dist',
filename: options.optimizeMinimize ? 'vizceral.min.js' : 'vizceral.js',
library: 'Vizceral',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
},
{ test: /\.glsl$/, loader: 'raw-loader' },
{ test: /\.woff2?$/, loader: 'url?limit=10000&mimetype=application/font-woff' },
{ test: /\.otf$/, loader: 'file' },
{ test: /\.ttf$/, loader: 'file' },
{ test: /\.eot$/, loader: 'file' },
{ test: /\.svg$/, loader: 'url' },
{ test: /\.html$/, loader: 'html' },
{ test: /\.css$/, loader: 'style!css' }
]
},
plugins: [
new webpack.DefinePlugin({
__DEBUG__: process.env.NODE_ENV !== 'production',
__HIDE_DATA__: !!process.env.HIDE_DATA
}),
]
};
if (!options.optimizeMinimize) {
config.devtool = 'source-map';
}
module.exports = config;