Skip to content

Commit

Permalink
Bump luma.gl version and add source map support in example (visgl#684)
Browse files Browse the repository at this point in the history
* Enable source maps in examples
  • Loading branch information
ibgreen authored Jun 5, 2017
1 parent 01196c7 commit 7b2045a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 3 additions & 3 deletions examples/layer-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"build": "webpack app bundle.js --env.local --display-error-details"
},
"dependencies": {
"deck.gl": "^4.0.0",
"deck.gl": ">=4.1.0-alpha.10",
"extrude-polyline": "^1.0.6",
"immutable": "^3.8.1",
"luma.gl": "^3.0.0",
"luma.gl": ">=4.0.0-alpha.9",
"react": "^15.4.1",
"react-autobind": "^1.0.6",
"react-dom": "^15.4.1",
"react-map-gl": "^3.0.0-alpha.5",
"react-map-gl": ">=3.0.0-alpha.12",
"react-stats": "^0.0.5",
"s2-geometry": "^1.2.9"
},
Expand Down
17 changes: 10 additions & 7 deletions examples/webpack.config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const LOCAL_DEV_CONFIG = {
}
},

devtool: 'source-map',

resolve: {
alias: {
// Imports the deck.gl library from the src directory in this repo
Expand All @@ -33,10 +35,10 @@ const LOCAL_DEV_CONFIG = {
module: {
rules: [
{
// Inline shaders
test: /\.glsl$/,
loader: 'raw-loader',
exclude: [/node_modules/]
// Unfortunately, webpack doesn't import library sourcemaps on its own...
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
}
]
},
Expand All @@ -47,6 +49,7 @@ const LOCAL_DEV_CONFIG = {
};

function addLocalDevSettings(config) {
config = Object.assign({}, LOCAL_DEV_CONFIG, config);
config.resolve = config.resolve || {};
config.resolve.alias = config.resolve.alias || {};
Object.assign(config.resolve.alias, LOCAL_DEV_CONFIG.resolve.alias);
Expand All @@ -58,10 +61,10 @@ function addLocalDevSettings(config) {
return config;
}

module.exports = baseConfig => env => {
const config = baseConfig;
module.exports = config => env => {
if (env && env.local) {
addLocalDevSettings(config);
config = addLocalDevSettings(config);
// console.warn(JSON.stringify(config, null, 2));
}

return config;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"build": "npm run build-clean && npm run build-es6 && npm run build-es5 && webpack -d --display-modules",
"cover": "NODE_ENV=test nyc --reporter html --reporter cobertura --reporter=lcov npm run test-cover",
"lint": "eslint src test examples && npm run lint-yarn",
"lint-yarn": "! grep -q unpm.u yarn.lock",
"lint-yarn": "!(grep -q unpm.u yarn.lock) || echo 'Please rebuild yarn file using public npmrc'",
"publish-prod": "npm run build && npm run test && npm run test-dist && npm publish",
"publish-beta": "npm run build && npm run test && npm run test-dist && npm publish --tag beta",
"test": "npm run lint && npm run build && npm run test-node",
Expand Down

0 comments on commit 7b2045a

Please sign in to comment.