Closed cskiwi closed 11 months ago
I'm not familiar with nx. Should this work out of the box?
I though it would, but I had to configure it in vite to use the nxViteTsPaths
, and that solved this issue.
so finally this would become:
import { angular } from '@nitedani/vite-plugin-angular/plugin';
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
import { vavite } from 'vavite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
angular(),
vavite({
serverEntry: '/src/server/main.ts',
serveClientAssetsInDev: true,
}),
nxViteTsPaths(), // this did the trick!
],
});
Thanks to @brandonroberts with AnalogJs for having this already solved!
Hi,
I've got the project up and running, but when I want to load a component from a library, the building process breaks:
[vite] Error when evaluating SSR module /src/app/app.component.ts: failed to import "@gull/welcome"
I tried some configurations, but the error persists. you got any suggestion? full repo can be found on: https://github.com/cskiwi/herring-gull-angular
UPDATE: On some further investigation I found that if I put the following in my vite.config.ts it works:
so it's because the nx libraries aren't resolved