forked from Netflix/vizceral-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
57 lines (54 loc) · 1.51 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
49
50
51
52
53
54
55
56
57
/* globals __dirname process module */
'use strict';
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: './src/app.jsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'vizceral.[hash].bundle.js'
},
resolve: {
alias: {
react: path.resolve('node_modules/react'),
},
extensions: ['.jsx', '.js'],
modules: ['node_modules'],
},
module: {
rules: [
{
test: /\.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{ 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: 'file-loader' },
{ test: /\.html$/, use: 'html-loader' },
{ test: /\.css$/, use: [{ loader: 'style-loader' }, { loader: 'css-loader' }] }
]
},
plugins: [
new webpack.ProvidePlugin({
// Automtically detect jQuery and $ as free var in modules
// and inject the jquery library
// This is required by many jquery plugins
jQuery: 'jquery',
$: 'jquery'
}),
new webpack.DefinePlugin({
__HIDE_DATA__: !!process.env.HIDE_DATA
}),
new HtmlWebpackPlugin({
title: 'Vizceral',
template: './src/index.html',
favicon: './src/favicon.ico',
inject: true
})
]
};