ladle
ladle copied to clipboard
Support NX
Documentation to support NX monorepo setup.
Adding a target for libs/ui -> project.json as follows:
"stories": {
"executor": "nx:run-commands",
"options": {
"command": "pnpm ladle serve"
}
}
and running nx run ui:stories runs successfully.
However is unable to resolve shared dependencies.
Do I need to add resolve alias to config.mjs?
Ok, this seems to work by setting up vite.config.ts:
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import path from 'path';
export default defineConfig({
plugins: [tsconfigPaths()],
resolve: {
alias: {
'@project/ui': path.resolve(__dirname, './libs/ui/src/index.ts'),
},
},
});