Open gperdomor opened 3 weeks ago
i tried it locally that i could see the compiled code. here are my steps:
in workspace root, add project.json and add local-registry target:
"local-registry": {
"executor": "@nx/js:verdaccio",
"options": {
"port": 4873
}
}
run npm login
then start the local registry
generate a @nx/js library using command nx g @nx/js:lib js-lib2 --verbose --buildable --publishable --importPath @test/lib2
in project.json, it generates a nx-release-publish
target:
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
}
then I run npx nx run js-lib2:build
, it generates compiled package under dist/js-lib2
then I run npx nx run js-lib2:nx-release-publish
to publish it. download the package zip and I can see compiled code
what does your project.json look like? what does your release-publish target look like?
@xiongemi check this repo to reproduce it... It's a fresh repo and I created the libs using nx console
Here you can see the builded code for both libs
Both are published without issues
Then I downloaded and uncompress the files... This is the result
lib-b
(vite + project.json) only includes package.json and readme
Hi folks... Did you was able to check this? @xiongemi @AgentEnder
Current Behavior
Packages bundled with vite are published without compiled code, only package.json file
Expected Behavior
Package should be published and ready to use with all the compiled code
GitHub Repo
No response
Steps to Reproduce
Nx Report
nx report
NX Report complete - copy this into the issue template
Node : 22.10.0 OS : darwin-x64 Native Target : x86_64-macos npm : 10.9.0
nx (global) : 20.0.6 nx : 20.0.6 @nx/js : 20.0.6 @nx/eslint : 20.0.6 @nx/workspace : 20.0.6 @nx/devkit : 20.0.6 @nx/eslint-plugin : 20.0.6 @nx/vite : 20.0.6 @nx/web : 20.0.6 typescript : 5.5.4
Registered Plugins: @nx/js/typescript @nx/vite/plugin @nx/eslint/plugin
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
I also created two vite libraries, one with project.json file and the other without them and I notice this behavior:
Build process: The lib with project.json output the builded sources to the list folder in the workspace root, while the lib without project.json output the compiled code inside a dist folder inside the library project root
Publishing the library without project.json file is working properly
Executors: The lib with project.json use
@nx/vite:build
as executor while the other uses justvite