Skip to content

Commit

Permalink
build: improve webpack configs for npm link
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud committed Jan 6, 2021
1 parent 6df8224 commit 7ede370
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions superset-frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
"outDir": "./dist",
"pretty": true,
"paths": {
"@superset-ui/core": [
"./node_modules/@superset-ui/core/src",
"./node_modules/@superset-ui/core"
],
"@superset-ui/chart-controls": [
"./node_modules/@superset-ui/chart-controls/src",
"./node_modules/@superset-ui/chart-controls"
],
// for supressing errors caused by incompatible @types/react when `npm link`
// Ref: https://github.com/Microsoft/typescript/issues/6496#issuecomment-384786222
"*": ["./node_modules/@types/*", "*"]
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ if (isDevMode) {
// only allow exact match so imports like `@superset-ui/plugin-name/lib`
// and `@superset-ui/plugin-name/esm` can still work.
config.resolve.alias[`${pkg}$`] = `${pkg}/src`;
delete config.resolve.alias[pkg];
hasSymlink = true;
}
});
Expand Down

0 comments on commit 7ede370

Please sign in to comment.