Skip to content

Instantly share code, notes, and snippets.

@jefffriesen
Created December 1, 2016 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jefffriesen/187418ac5b5fd34e34728e22ac98db64 to your computer and use it in GitHub Desktop.
Save jefffriesen/187418ac5b5fd34e34728e22ac98db64 to your computer and use it in GitHub Desktop.
Webpack config for deck.gl (not working)
/* 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
// Based on https://gist.github.com/tehwalris/606dcc8d8974e4e48740ed204e166bac
module.exports = {
module: {
// noParse: /node_modules\/mapbox-gl\/dist\/mapbox-gl.js/,
loaders: [
{
test: /\.jsx?$/,
loaders: ['babel-loader'],
exclude: /node_modules/
},
{
test: /mapbox-gl.+\.js$/,
query: 'brfs',
loader: 'transform-loader'
},
{
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: {
"webworkify": 'webworkify-webpack',
'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