-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
31 lines (29 loc) · 1007 Bytes
/
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
var Webpack = require('webpack')
var path = require('path')
var nodeModulesPath = path.resolve(__dirname, 'node_modules')
var buildPath = path.resolve(__dirname, 'public', 'build')
var mainPath = path.resolve(__dirname, 'app', 'main.jsx')
var sassPath = path.resolve(__dirname, 'app', 'main.scss')
var colorMaps = path.resolve(nodeModulesPath, 'colormap', 'colorScales.json')
var config = {
devtool: 'eval',
// devtool: 'eval-source-map',
entry: ['webpack/hot/dev-server', 'webpack-dev-server/client?http://localhost:8080', mainPath],
output: {
path: buildPath,
filename: 'bundle.js',
publicPath: '/build/'
},
module: {
loaders: [
{test: colorMaps, loader: 'json'},
{test: /\.jsx$/, loader: 'babel-loader', exclude: [nodeModulesPath], query: {presets: ['react']}},
{test: /\.scss$/, loaders: ['style', 'css', 'sass']}
]
},
plugins: [new Webpack.HotModuleReplacementPlugin()],
sassLoader: {
includePaths: [sassPath]
}
}
module.exports = config