You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Shared modules are proving to be quite a mess in the Angular 2/Ionic 2 world. Although a shared module template has been provided this seems to break quite easily when you want to use js libraries like pouchdb in the shared module. Its also a bit of a pain to have to compile the typescript with every change the you are writing the shared module in parallel to app development.
A simple solution is to use git sub modules however a simpler solution for be symlink support in the build scripts. This way you could just symlink the shared module (all typescript) into the src folder and build away.
The text was updated successfully, but these errors were encountered:
Hi. I agree that symlink support is a must for a rapid shared module development. I was able to get it working with app-scripts version "0.0.47" after some trial and error. To save time for fellow developers, here’s what I had to do.
Add symlink to the source root of your shared module in the project that imports it. I added symlink directly under the src folder but I don’t know if this is a hard requirement. If you are writing a js script to do this, you can use:
Add a bit of custom configuration to webpack.config.js and watch.config.js. I copied and modified the original files and then pointed to them in “config” section of package.json.
In watch.config.js
Add your symlinked folder to srcFiles.paths. You will have to explicitly add the path even if you symlink your shared module under the source folder of your app due to an issue (I believe) with “chokidar” dependency. For example, for a module called “mysharedmodule” symlinked directly under source folder your would change:
Shared modules are proving to be quite a mess in the Angular 2/Ionic 2 world. Although a shared module template has been provided this seems to break quite easily when you want to use js libraries like pouchdb in the shared module. Its also a bit of a pain to have to compile the typescript with every change the you are writing the shared module in parallel to app development.
A simple solution is to use git sub modules however a simpler solution for be symlink support in the build scripts. This way you could just symlink the shared module (all typescript) into the src folder and build away.
The text was updated successfully, but these errors were encountered: