build: fix emotion theme errors when npm link @superset-ui/core (#12510)

This commit is contained in:
Jesse Yang 2021-01-14 10:20:13 -08:00 committed by GitHub
parent 78baf46eb2
commit eec78560f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -274,8 +274,12 @@ const config = {
modules: [APP_DIR, 'node_modules'],
alias: {
'react-dom': '@hot-loader/react-dom',
// force using absolute import path of the @superset-ui/core and @superset-ui/chart-controls
// so that we can `npm link` viz plugins without linking these two base packages
// Force using absolute import path of some packages in the root node_modules,
// as they can be dependencies of other packages via `npm link`.
// Both `@emotion/core` and `@superset-ui/core` remember some globals within
// module after imported, which will not be available everywhere if two
// different copies of the same module are imported in different places.
'@emotion/core': path.resolve(APP_DIR, './node_modules/@emotion/core'),
'@superset-ui/core': path.resolve(
APP_DIR,
'./node_modules/@superset-ui/core',