Ionic 1.x - from the gazebo to the gamut

I used to install plugins in my ion project 1 with a gazebo. A new trend, especially with ion 2, is installing packages with npm. Some basic packages, such as ionic.cloud , are no longer provided with a gazebo even for ionic 1.x.

So, I need to transfer some packages to npm number. What is the recommended way to do this?

My problem:

  • "npm install" seems to install packages in the "my_project / node_modules" folder, unlike bower, which installs packages directly in my_project / www / lib /
  • As explained, for example, in the ionic.cloud installation guide , this requires an additional step to copy the recently installed npm package to the lib folder with the command:

    cp node_modules/@ionic/cloud/dist/bundle/ionic.cloud.min.js www/lib 

However, when I update the package and run "npm update", this will update the node_modules folder, but not the lib folder. This is a problem since only the files from my lib folder are included in my index.html.

Running a cp command after every npm update doesn't seem like such an elegant solution. What is the recommended way to handle this?

+6
source share
1 answer

I think you can undo this so that the .bowerrc file .bowerrc your packages inside the node_modules folder and uses this path by default. Otherwise, the node_modules parameter is required; its creation is impossible. Even you can npm i --prefix ./bower_components/ <package> still need cp for the folders in the bower_components folder

0
source

Source: https://habr.com/ru/post/1012604/


All Articles