-
Notifications
You must be signed in to change notification settings - Fork 310
Verify works with linked modules #635
Comments
Would love to see this issue fixed! Really difficult to do rapid local development on shared codebases without this. Any recommended workarounds in the meantime? |
Copy and paste the node_module lib. That's what we do with Ionic right now. I will hopefully have some time to fix this soon. Thanks, |
Hey Dan, Could you explain in a little more detail what you mean by copying the "node_module lib"? Are you referring to the "node_modules" directory? If so, copy it from where to where? Thanks! Was this while the project was symlinked or not? Etc. Thanks! |
If you're developing another library that you want to link into an Ionic project, the short term work around is to just build the project and copy/paste to your local node_modules directory. It's not ideal but it's what we currently do with testing. We need to fix linking. Thanks, |
Oh. Okay. What I've been doing is just It's not ideal for CI builds or rapid dev,since TS ngc builds can take some time, by it's working enough for us to get by. Linking would obviously make it easier :) Thanks for keeping eyes on this. |
Alternatively, what you can do if you want it more automated, from your library you do a normal I have a script to do something similar, I am not 100% sure it works perfectly cause I had to strip out some code that is not relevant for you. But should be a good starting point. Script below; to run it you can use ts-node |
I am setting up something similar for how we will approach Ionic apps. We have a separate project/module setup for components, etc that will be shared among multiple apps. To get this to work I am using npm link, additions to tsconfig for the share dmodule, and some a custom watch.config.js to get it to check the shared module's folder. However, the shared module is not built on an ionic serve, but is built and works fine if a file is modified to force a live reload. This is all based on the method described in this article: However, I see the author has just posted an alternative solution, so I will also explore that. |
Yes, adding paths to tsconfig will work. As the main issue that i had, but
with and without the appscripts that npm link, will steal dependencies,
from the linked modules. Aot will fail misrable, while in Jit you will have
issues with observables typings on custom interfaces (if you are using
them) that don't match unless you install typings.
In future, when I have some try I will definitly give the taconfig
implementation a try, as It should be a simplier solution.
…On Wed, 26 Apr 2017 at 18:22, ChristopherTotty ***@***.***> wrote:
I am setting up something similar for how we will approach Ionic apps. We
have a separate project/module setup for components, etc that will be
shared among multiple apps. To get this to work I am using npm link,
additions to tsconfig for the share dmodule, and some a custom
watch.config.js to get it to check the shared module's folder. However, the
shared module is not built on an ionic serve, but is built and works fine
if a file is modified to force a live reload.
This is all based on the method described in this article:
***@***.***/sharing-logic-between-ionic2-apps-f06feaf51fad
However, I see the author has just posted an alternative solution, so I
will also explore that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#635 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQv-WkhjDThCgPJgLqKGObJmpLsuh0RZks5rz29ZgaJpZM4LeqPU>
.
|
Just finished switching over to Martin's 2nd example using tsconfig paths instead of npm link and it works great. Fixes the issue I was having with ionic serve's build requiring a forced live reload to work. https://medium.com/@blewpri/sharing-code-in-angular2-ionic2-apps-simply-without-npm-5203048ec1e1 |
I am also looking forward to a solution for npm links... (See https://forum.ionicframework.com/t/share-modules-between-apps-architecture/116885/13 where I try to figure out a clean way to share modules between apps without copy & paste) |
any updates since? |
angular has an option |
Verify everything plays nicely with npm linked modules.
ionic serve
and verify that app-scripts handles the sym links correctlyThanks,
Dan
The text was updated successfully, but these errors were encountered: