Last active
December 1, 2016 17:29
-
-
Save jefffriesen/76e370bd5031c982f8aae7606fa21788 to your computer and use it in GitHub Desktop.
Webpack config for deck.gl (working for react-map-gl)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint strict: 0 */ | |
'use strict'; | |
const webpack = require('webpack') | |
const path = require('path') | |
// Attempt at getting deck.gl working with webpack. See https://github.com/uber/deck.gl/issues/247 | |
// This works for react-map-gl but not deck.gl. | |
module.exports = { | |
module: { | |
noParse: /node_modules\/mapbox-gl\/dist\/mapbox-gl.js/, | |
loaders: [ | |
{ | |
test: /\.jsx?$/, | |
loaders: ['babel-loader'], | |
exclude: /node_modules/ | |
}, { | |
test: /\.json$/, | |
loader: 'json-loader' | |
} | |
] | |
}, | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: 'bundle.js', | |
libraryTarget: 'commonjs2' | |
}, | |
resolve: { | |
extensions: ['', '.js', '.jsx'], | |
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main'], | |
alias: { | |
'crossfilter': 'crossfilter2', | |
'mapbox-gl/js/geo/transform': path.join(__dirname, "/node_modules/mapbox-gl/js/geo/transform"), | |
'mapbox-gl': path.join(__dirname, "/node_modules/mapbox-gl/dist/mapbox-gl.js") | |
} | |
}, | |
plugins: [ | |
// Don't load the huge moment locale translations | |
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), | |
], | |
node: { | |
"canvas": "empty", | |
"jsdom": "empty" | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment