Right now, There isn't a good way to get npm link working for the Ionic repo.
We execute the following process to test local builds.
gulp package build 鈥攖ypecheck
** delete contents of test project's node_modules/ionic-angular dir **
** copy and paste contents of ionic/dist to test project's node_modules/ionic-angulardir **
It is not the best process. npm link would work much better but the build process does not support it right now.
I have no idea how this affects browserify, but when using webpack, I banged into this issue and this issue and this issue, which all resulted in rather mysterious bugs due to two angulars being included in the build. However, adding the following aliases to the test project (the npm link consumer) seems to have resolved the issue, allowing me to use an npm linked ionic. I don't know if this is the problem you're referencing, but since I spent the last day and a half banging my head against the wall on this, I thought I would at least share what I learned.
"@angular/common": path.resolve(__dirname, "node_modules/@angular/common"),
"@angular/compiler": path.resolve(__dirname, "node_modules/@angular/compiler"),
"@angular/core": path.resolve(__dirname, "node_modules/@angular/core"),
"@angular/forms": path.resolve(__dirname, "node_modules/@angular/forms"),
"@angular/http": path.resolve(__dirname, "node_modules/@angular/http"),
"@angular/platform-browser": path.resolve(__dirname, "node_modules/@angular/platform-browser"),
"@angular/platform-browser-dynamic": path.resolve(__dirname, "node_modules/@angular/platform-browser-dynamic")
Hi @rapropos,
Thanks for sharing! I'll try it on Tuesday and get back to you!
Thanks,
Dan
Hi @rapropos,
It might be a few days. Really swamped right now!
Thanks!
Dan
Thanks so much for those aliases which will probably solve my problem @rapropos, but I am not sure how to use them. Where do I put those? I don't have a webpack.config.js - my project does not use webpack (also tried a project started with ionic start tabs-test tabs and it too does not use webpack) - but these aliases seem like webpack config aliases, not sure. But thanks for the lead that two angulars are being loaded - checking up on that...
Changing assignment to @jthoms1 to ensure this works with forth coming webpack build process.
Most helpful comment
I have no idea how this affects browserify, but when using webpack, I banged into this issue and this issue and this issue, which all resulted in rather mysterious bugs due to two angulars being included in the build. However, adding the following aliases to the test project (the
npm linkconsumer) seems to have resolved the issue, allowing me to use annpm linked ionic. I don't know if this is the problem you're referencing, but since I spent the last day and a half banging my head against the wall on this, I thought I would at least share what I learned.