Open simedia-fabianamhof opened 2 weeks ago
Removing the if condition in packages/vite/src/plugins/plugin.ts:194
would solve this bug.
// If running in library mode, then there is nothing to serve.
if (!viteConfig.build?.lib) {
targets[options.serveTargetName] = serveTarget(projectRoot);
targets[options.previewTargetName] = previewTarget(projectRoot);
targets[options.serveStaticTargetName] = serveStaticTarget(options) as {};
}`
Current Behavior
Since v19.3.1 the @nx/vite plugin does not create serve, serve-static and preview targets if vite is configured in library mode. This is wrong since these commands do work properly in vite if you have set up a demo
index.html
file (https://vitejs.dev/guide/build#library-mode).Error:
NX Cannot find configuration for task my-lib:serve
Expected Behavior
The targets should execute the corresponding vite commands like in the previous NX versions.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response