How link WebMap package to the migrated Application
Sometimes when we want to debug a frontend package in the migrated application the process of generating a package, and installing it, and then using it can be a bit slow.
npm has a feature called link, which allows us to link the node_module of a package to an address on the PC's storage. For example, if we have a migrated application and we want to make some changes in the @mobilize/winforms-components repository, you do the yarn install or the npm install that you normally do, but how can you make changes to that package and test them in the migrated application?
setup the npm link
Let's assume that you have a migrated project, to which you want to connect the @mobilize/winforms-components repository to test some changes.
1. Compile the @mobilize/winforms-components
Go to the repository path, in my case is D:\Repositories\WFNetKendoComponents\WinformsComponentopen a cmd and compile the application
2. NPM link the dist folder
Go with the terminal to the dist folder after compiling the repository, in my case is D:\Repositories\WFNetKendoComponents\WinformsComponent\dist and execute the link command.
You should see something like that:
3. Update angular.json of the migrated project
Add a new property preserveSymlinks in the angular.json of the migrated project.
4. Link the repository to the migrated application
Open a cmd in the root of the migrated application and execute the next npm link with the package_name:
you should see something like:
If you check your node_modules you should see a shortcut in your package folder
5. Compile your migrated application
After link the package, you must compile your application as usual, for example
or
or
Test changes
Suppose you already did the linking process and you made a change to the @mobilize/winforms-components repository that you want to test in your migrated application.
Stop the ng serve process if you are using it in the migrated application.
Compile the repository with the change made.
Compile the migrated application or start the ng serve process.
Supported repositories for the link process
@mobilize/angularclient
@mobilize/base-components
@mobilize/winforms-components
@mobilize/powercomponents
@mobilize/jns-winforms-components
@mobilize/acs-winforms-components
You can use one or more linked repositories in a migrated application.
Unlink repository
you can execute the unlink command to delete the link folder.
Last updated