forked from Netflix/vizceral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
48 lines (44 loc) · 1.24 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
const path = require('path');
const webpack = require('webpack');
const yargs = require('yargs');
const options = yargs
.alias('p', 'optimize-minimize')
.alias('d', 'debug')
.argv;
const config = {
entry: './src/vizceral.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: options.optimizeMinimize ? 'vizceral.min.js' : 'vizceral.js',
library: 'Vizceral',
libraryTarget: 'umd',
umdNamedDefine: true
},
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{ test: /\.glsl$/, use: 'raw-loader' },
{ test: /\.woff2?$/, use: 'url-loader?limit=10000&mimetype=application/font-woff' },
{ test: /\.otf$/, use: 'file-loader' },
{ test: /\.ttf$/, use: 'file-loader' },
{ test: /\.eot$/, use: 'file-loader' },
{ test: /\.svg$/, use: 'url-loader' },
{ test: /\.html$/, use: 'html-loader' },
{ test: /\.css$/, use: 'style-loader!css-loader' }
]
},
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;