-
Notifications
You must be signed in to change notification settings - Fork 12k
Bundle does not include 3rd party lib after ng-build --prod #11409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This appears to be a bug but we will need to look at a reproduction to find and fix the problem. Can you setup a minimal reproduction please? You can read here why this is needed. A good way to make a minimal reproduction is to create a new app via |
It is something with cache, I created one repro app and a repro-lib, did a few tests and it works, it updates the code normally. Is there any cache with angular-cli or webpack? I saw in some issues here about angular-cli relying on a symlink on dist folder. I have different folder names on my main project. Im not using src and dist folders. Do you think its related? |
When I delete my node_modules folder and all dist folder, npm instal and ng build --prod again, it brings the last lib code to the vendor file |
The only way I found to make my build to include updates on my lib is to |
I posted this issue on webpack repo. No solution until now... |
I'm also having the same issue and running a I had also tried making changes to my Just to clarify, I have 3 sub-packages that are getting built locally and I was using an After linking the other local sub-packages, I run |
There was a point at which we had some cache for prod builds (specifically for Build Optimizer) that had some edge cases where it didn't work. We've since removed it. I think that might have been the cause of the problem on our side. Not sure what the problem might be with the npm cache proper, if at all. But this repo wouldn't be the right place to address it. In regards to |
Using the latest version of everything mentioned above and it does not happen anymore. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions
Repro steps
1 - Created I lib in a different workspace from the main project.
2- Published to a private npm.
3 - Installed the lib in the same workspace with a test project,
npm install @org/my-lib
, ng serve works and ng-build works, (it has the lib code in the bundle file)4 - Installed the lib in my main project (that will consume the lib), its in another workspace.
5- ng serve works, ng build --prod does not include the lib code into the bundle.
Mention any other details that might be useful
The main project was upgraded from angular 5 to 6 one month ago using angular cli.
If I install the lib using the tgz file directly
"my-lib": "file:../../my-project/dist/my-lib"
, ng-build --prod works and the code in included in the bundle.If I install the lib using the tgz file from cloud
"my-lib": "https://myserver/my-lib.0.0.1.tgz"
, it does not include the lib code into the bundle fileIf I install the lib using
"@org/my-lib":"0.0.1"
, ng build --prod does'n include the lib code into the bundleThe text was updated successfully, but these errors were encountered: