Tableau UI for Angular
Local Development
Link the library's build into an app, to try a change to the library in the app before it is published.
Link
Open the library's checkout and the app side by side; the steps below are the ones dev:link prints, with the paths on your machine.
- In the library's checkout, run the script. It builds the library, prints the steps, waits for Enter, and then builds the library again on each change.
npm run dev:link- In the app's
angular.json, preserve symlinks in the build, and leave the library out of the dev server's prebundling:
{
"projects": {
"[your-app]": {
"architect": {
"build": {
"options": {
"preserveSymlinks": true
}
},
"serve": {
"options": {
"prebundle": {
"exclude": ["tableau-ui-angular"]
}
}
}
}
}
}
} The app's tsconfig.json needs no change: TypeScript and the build find each tableau-ui-angular/<folder> import through the package's exports, in the folder npx link puts in the app's node_modules, as they do for the published package.
- In the app, install
link:
npm install --save-dev link- In the app, run the
npx linkline the script printed. It links the library's build, and Angular's packages and Monaco from the library's checkout; here<library>stands for the checkout's path.
npx link <library>/node_modules/@angular/common <library>/node_modules/@angular/core <library>/node_modules/@angular/forms <library>/node_modules/@angular/router <library>/node_modules/monaco-editor <library>/dist/component-libraryUnlink
When you are done, or before you commit the app, run this in the app, as the script says:
npm install