Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Fixed website configuration to correctly import local kepler files #2454

Merged
merged 1 commit into from Nov 21, 2023

Conversation

macrigiuseppe
Copy link
Collaborator

@macrigiuseppe macrigiuseppe commented Nov 21, 2023

The website webpack configuration was loading kepler.gl files node_modules rather than local src files.

This PR makes sure the correct aliases (copied from examples webpack config) are used.

I combined several webpack configuration variables into one shared file

Comment on lines +8 to +44
const resolveAlias = {
react: `${NODE_MODULES_DIR}/react`,
'react-dom': `${NODE_MODULES_DIR}/react-dom`,
'react-redux': `${NODE_MODULES_DIR}/react-redux/lib`,
'styled-components': `${NODE_MODULES_DIR}/styled-components`,
'react-intl': `${NODE_MODULES_DIR}/react-intl`,
// Suppress useless warnings from react-date-picker's dep
'tiny-warning': `${SRC_DIR}/utils/src/noop.ts`
};

// add kepler.gl submodule aliases
const workspaces = KeplerPackage.workspaces;
workspaces.forEach(workspace => {
// workspace = "./src/types", "./src/constants", etc
const moduleName = workspace.split('/').pop();
resolveAlias[`@kepler.gl/${moduleName}`] = join(SRC_DIR, `${moduleName}/src`);
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part makes sure to generate the correct aliases for examples and website

Comment on lines +27 to +28
const LIB_DIR = resolve(__dirname, '..');
const SRC_DIR = resolve(LIB_DIR, './src');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made them consistent with the examples/webpack.config.local.js

Signed-off-by: Giuseppe Macri <gmacri@foursquare.com>
Comment on lines +86 to +88
test: /\.mjs$/,
include: /node_modules\/apache-arrow/,
type: 'javascript/auto'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sure apache arrow files are imported correctly. copied from examples/webpack.config.local.js

Copy link
Collaborator

@igorDykhta igorDykhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@macrigiuseppe macrigiuseppe merged commit 5eb62a9 into master Nov 21, 2023
8 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix_website_webpack branch November 21, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants