You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/11/04 06:43:17 UTC
[incubator-superset] 01/02: build: update webpack for npm linking
plugins (#11253)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch 0.38
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
commit c8d0778b897cf92432c26665ba3566bc838b4693
Author: Jesse Yang <je...@airbnb.com>
AuthorDate: Tue Oct 13 16:54:06 2020 -0700
build: update webpack for npm linking plugins (#11253)
---
superset-frontend/tsconfig.json | 3 ++-
superset-frontend/webpack.config.js | 15 +++++++++++----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/superset-frontend/tsconfig.json b/superset-frontend/tsconfig.json
index 3f4dce9..6a8959e 100644
--- a/superset-frontend/tsconfig.json
+++ b/superset-frontend/tsconfig.json
@@ -30,5 +30,6 @@
"./node_modules/*superset-ui*/**/types/**/*",
// and the type defs of their dependencies
"./node_modules/*superset-ui*/**/node_modules/**/*.d.ts"
- ]
+ ],
+ "exclude": ["./node_modules/*superset-ui*/**/node_modules/@superset-ui/**/*"]
}
diff --git a/superset-frontend/webpack.config.js b/superset-frontend/webpack.config.js
index 51e7eb2..26f769c 100644
--- a/superset-frontend/webpack.config.js
+++ b/superset-frontend/webpack.config.js
@@ -265,12 +265,19 @@ const config = {
},
},
resolve: {
+ modules: [APP_DIR, 'node_modules'],
alias: {
- src: path.resolve(APP_DIR, './src'),
'react-dom': '@hot-loader/react-dom',
- stylesheets: path.resolve(APP_DIR, './stylesheets'),
- images: path.resolve(APP_DIR, './images'),
- spec: path.resolve(APP_DIR, './spec'),
+ // 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
+ '@superset-ui/core': path.resolve(
+ APP_DIR,
+ './node_modules/@superset-ui/core',
+ ),
+ '@superset-ui/chart-controls': path.resolve(
+ APP_DIR,
+ './node_modules/@superset-ui/chart-controls',
+ ),
},
extensions: ['.ts', '.tsx', '.js', '.jsx'],
symlinks: false,