forked from Netflix/vizceral-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (54 loc) · 1.55 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
/* globals __dirname process */
'use strict';
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'source-map',
entry: './src/app.jsx',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/',
filename: 'vizceral.[hash].bundle.js'
},
resolve: {
extensions: ['', '.jsx', '.js'],
modulesDirectories: ['node_modules'],
fallback: path.join(__dirname, 'node_modules')
},
resolveLoader: { fallback: path.join(__dirname, 'node_modules') },
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel'
},
{ test: /\.woff2?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
{ test: /\.otf$/, loader: 'file-loader' },
{ test: /\.ttf$/, loader: 'file-loader' },
{ test: /\.eot$/, loader: 'file-loader' },
{ test: /\.svg$/, loader: 'file-loader' },
{ test: /\.html$/, loader: 'html' },
{ test: /\.css$/, loader: 'style-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
})
]
};