-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
64 lines (62 loc) · 1.45 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
58
59
60
61
62
63
var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var nib = require('nib');
module.exports = {
target: 'web',
cache: false,
context: __dirname,
debug: true,
entry: [ './src/js/index' ],
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js',
chunkFilename: '[name].[id].js'
},
plugins: [
new ExtractTextPlugin('bundle.css'),
new HtmlWebpackPlugin({
title: 'Periodic table of the chimical elements - A data visualization by vogelino',
filename: 'index.html',
template: './src/html/index.ejs',
inject: 'body'
})
],
module: {
loaders: [
{
test: /\.json$/, loaders: [ 'json' ]
},
{
test: /\.(ico|gif|png|jpg|jpeg|svg|webp)$/,
loaders: [ 'file?context=static&name=/[name].[ext]?v=[hash:6]' ],
exclude: /node_modules/
},
{
test: /\.(ttf|eot|woff(2)?)(\?[a-z0-9]+)?$/,
loaders: [ 'file?context=static&name=/[path][name].[ext]' ],
exclude: /node_modules/
},
{
test: /\.js$/,
loaders: [ 'babel?presets[]=es2015&presets[]=stage-0&presets[]=react' ],
exclude: /node_modules/
},
{
test: /\.styl$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!stylus-loader')
}
]
},
resolve: {
modulesDirectories: [
'src',
'node_modules'
],
extensions: [ '', '.json', '.js' ]
},
stylus: {
use: [ nib() ]
}
};