-
Notifications
You must be signed in to change notification settings - Fork 12k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular7 - Production build fails while going through Bitbucket package: ng build --prod #13665
Comments
Hi @joseph118, a couple of problems here,
A way to get around this is to use tsconfig path. "paths": {
"lib-module": [
"./node_modules/ng-module-x/dist/lib-module"
],
"lib-module/*": [
"./node_modules/ng-module-x/dist/lib-module/*"
]
}, and change your imports to; import { LibModuleModule } from 'lib-module'; That said, I would suggest that you actually publish the library to a private npm repo as this will improve the install time as during npm install it will not need to be build the library everytime. |
Hi @alan-agius4 , Thank you for your guideline, it helped me realise what the problem actually was. Going with that approach would force me to configure every application that may use the module, and I wasn't assuming that angular would try to guess the module name given that everything is in the package.json. I tested out some changes and updated the name property from package.json of the module to be exactly the same as the library name. The changes have been applied on the given branches and the prod build has been successful. I appreciate the tip but at the moment I was trying out Bitbucket npm feature. (Y) Thank you! |
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
Command (mark with an
x
)Description
I would like to build a system where angular components can be re-used across multiple applications using bitBucket.
At the moment I have the following:
BitBucket Repo A - to store the node module. At the moment the module is created as a library and the main application is being used as a demo. The library is built and exported when requesting the module from this repo. (https://bitbucket.org/joseph118/ng-module-x/src/master/)
BitBucket Repo B - Application which makes use of "BitBucket Repo A" (installs the library) and more (Web app). (https://bitbucket.org/joseph118/app-x/src/master/)
On Repo A, the application is able to build, production build, build the library and also serve.
On Repo B, the application is able to build and serve, however it fails on production build. This will end up throwing 'module not found' but checking the node_modules folder, I can verify that everything seems to be in order.
馃敩 Minimal Reproduction
Replication Steps:
Generating project
馃敟 Exception or Error
In this case, I executed the following command: 'ng build --prod --verbose' to get more information from the process. However I ended up with the following:
馃實 Your Environment
The text was updated successfully, but these errors were encountered: