mirror of
https://github.com/apache/superset.git
synced 2024-09-19 20:19:37 -04:00
a716fd1168
Frontend code has been moved by a005e4568f
1.4 KiB
1.4 KiB
Debugging Superset plugins in Superset app
Activating plugins for local development
- Enable
npm link
for the package.
cd superset-ui
cd packages/superset-ui-chart
npm link
- Link the local package to
incubator-superset
.
cd incubator-superset/superset-frontend
npm link @superset-ui/chart \# use package name in package.json, not directory name
- After npm link complete, update the import statements in Superset.
Instead of
import { xxx } from '@superset-ui/plugin-chart-horizon';
which will point to the transpiled code.
do refer to src
import { xxx } from '@superset-ui/plugin-chart-horizon/src';
- After that you can run
dev-server
as usual.
npm run dev-server
Now when you change the code in @superset-ui
, it will update the app immediately similar to code
inside incubator-superset
.
Deactivating plugins for local development
-
Change the
import
statements back. -
Unlink the package from
incubator-superset
.
cd incubator-superset/superset-frontend
npm unlink @superset-ui/chart
Note: Quite often, npm link
mess up your node_modules
and the unlink
command above does not
work correctly, making webpack build fails or other unexpected behaviors. If that happens, just
delete your node_modules
and npm install
from scratch.
- Clean up global link.
cd superset-ui
cd packages/superset-ui-chart
npm unlink