Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[Bug]: fix alias and module resolve in webpack.config.local (#348)

Shan Heb4366ae28325
diff --git a/examples/webpack.config.local.js b/examples/webpack.config.local.js
index 6b3e48380..8bdcc9749 100644
--- a/examples/webpack.config.local.js
+++ b/examples/webpack.config.local.js
@@ -27,6 +27,7 @@
// avoid destructuring for older Node version support
const resolve = require('path').resolve;
+const join = require('path').join;
const webpack = require('webpack');
const path = require('path');
const LIB_DIR = resolve(__dirname, '..');
@@ -46,6 +47,8 @@ function makeLocalDevConfig(EXAMPLE_DIR = LIB_DIR) {
resolve: {
alias: {
+ // Imports kepler.gl library from the src directory in this repo
+ 'kepler.gl': SRC_DIR,
react: resolve(EXAMPLE_DIR, './node_modules/react'),
'styled-components': resolve(EXAMPLE_DIR, './node_modules/styled-components')
}
@@ -71,8 +74,6 @@ function makeLocalDevConfig(EXAMPLE_DIR = LIB_DIR) {
};
}
-const astResolver = sourcePath => sourcePath.startsWith('kepler.gl') ? path.join(__dirname, `../src`) : sourcePath;
-
const BABEL_RULE = {
module: {
rules: [
@@ -88,42 +89,38 @@ const BABEL_RULE = {
'@babel/preset-react'
],
plugins: [
- ["@babel/plugin-proposal-decorators", { "legacy": true }],
- "@babel/plugin-proposal-class-properties",
- ["@babel/transform-runtime", {
- "regenerator": true
+ ['@babel/plugin-proposal-decorators', {legacy: true}],
+ '@babel/plugin-proposal-class-properties',
+ ['@babel/transform-runtime', {
+ regenerator: true
}],
- "@babel/plugin-syntax-dynamic-import",
- "@babel/plugin-syntax-import-meta",
- "@babel/plugin-proposal-json-strings",
- "@babel/plugin-proposal-function-sent",
- "@babel/plugin-proposal-export-namespace-from",
- "@babel/plugin-proposal-numeric-separator",
- "@babel/plugin-proposal-throw-expressions",
- "@babel/plugin-proposal-export-default-from",
- "@babel/plugin-proposal-logical-assignment-operators",
- "@babel/plugin-proposal-optional-chaining",
+ '@babel/plugin-syntax-dynamic-import',
+ '@babel/plugin-syntax-import-meta',
+ '@babel/plugin-proposal-json-strings',
+ '@babel/plugin-proposal-function-sent',
+ '@babel/plugin-proposal-export-namespace-from',
+ '@babel/plugin-proposal-numeric-separator',
+ '@babel/plugin-proposal-throw-expressions',
+ '@babel/plugin-proposal-export-default-from',
+ '@babel/plugin-proposal-logical-assignment-operators',
+ '@babel/plugin-proposal-optional-chaining',
[
- "@babel/plugin-proposal-pipeline-operator",
+ '@babel/plugin-proposal-pipeline-operator',
{
- "proposal": "minimal"
+ proposal: 'minimal'
}
],
- "@babel/plugin-proposal-nullish-coalescing-operator",
- "@babel/plugin-proposal-do-expressions",
- "@babel/plugin-proposal-function-bind",
- "@babel/plugin-transform-modules-commonjs",
- ["inline-json-import", {}],
+ '@babel/plugin-proposal-nullish-coalescing-operator',
+ '@babel/plugin-proposal-do-expressions',
+ '@babel/plugin-proposal-function-bind',
+ '@babel/plugin-transform-modules-commonjs',
+ ['inline-json-import', {}],
[
- "module-resolver",
+ 'module-resolver',
{
- "root": [
- "../src"
- ],
- "alias": {
- "test": "../test"
- },
- "resolver": astResolver
+ root: [
+ SRC_DIR
+ ]
}
]
]
@@ -156,17 +153,9 @@ function addBableSettings(config) {
}
module.exports = (config, exampleDir) => env => {
- // npm run start-local now transpiles the lib
- // if (env && env.local) {
+
config = addLocalDevSettings(config, exampleDir);
config = addBableSettings(config);
- // }
-
- // npm run start-es6 does not transpile the lib
- // if (env && env.es6) {
- // config = addLocalDevSettings(config, exampleDir);
- // console.warn(JSON.stringify(config, null, 2));
- // }
return config;
};
diff --git a/src/components/common/info-helper.js b/src/components/common/info-helper.js
index 42d0fafeb..26f073f73 100644
--- a/src/components/common/info-helper.js
+++ b/src/components/common/info-helper.js
@@ -27,16 +27,16 @@ import styled from 'styled-components';
const StyledInfoHelper = styled.div`
align-items: center;
margin-left: 10px;
- color: ${props =>props.theme.labelColor};
+ color: ${props => props.theme.labelColor};
display: inline-flex;
.info-helper__content {
max-width: 100px;
}
-
+
:hover {
cursor: pointer;
- color: ${props =>props.theme.textColorHl};
+ color: ${props => props.theme.textColorHl};
}
`;
diff --git a/src/components/side-panel/layer-panel/layer-config-group.js b/src/components/side-panel/layer-panel/layer-config-group.js
index 2951f1b86..d52152737 100644
--- a/src/components/side-panel/layer-panel/layer-config-group.js
+++ b/src/components/side-panel/layer-panel/layer-config-group.js
@@ -38,7 +38,6 @@ export const StyledLayerConfigGroupLabel = styled.div`
export const StyledLayerConfigGroup = styled.div`
padding-left: 18px;
margin-bottom: 18px;
-
`;
export const StyledConfigGroupHeader = styled.div`