-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
480aaae
to
bc83b79
Compare
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`); | ||
}); |
There was a problem hiding this comment.
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
const LIB_DIR = resolve(__dirname, '..'); | ||
const SRC_DIR = resolve(LIB_DIR, './src'); |
There was a problem hiding this comment.
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>
bc83b79
to
01c3a24
Compare
test: /\.mjs$/, | ||
include: /node_modules\/apache-arrow/, | ||
type: 'javascript/auto' |
There was a problem hiding this comment.
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
There was a problem hiding this 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
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