1

I am Using chat UIKit which is available in React.js and I have files of Uikit in the ‍‍node_modules folder. I want to edit these files according to my requirements Is it possible I can change these file's code and run? When I change in the node_modules folder then not impact my project.

Alireza
  • 2,319
  • 2
  • 23
  • 35
Farhad
  • 11
  • 2

3 Answers3

0

First of all fork the library or copy it into your project folder outside of node_modules, then edit the files of this library and last but not the least now import this library from local directory and delete it from node_modules. This will increase your bundle size.

0

You can fork it and then edit the package but it will not get updated and you have to address the package with git URL which is mentioned here

But I recommend that if you want to change any styles you use CSS selector in your project and if it's functional capabilities such as adding new props you should create a new component that wraps your UIkits component and try to add functionality on your wrapper component. this way you will get updates and also if you remove your forked repo you still can use your project.

Alireza
  • 2,319
  • 2
  • 23
  • 35
0

You can use patch-package . Through patch-package you can push your patches to production and patch-package will apply your patches each time you run "npm install" command as patch-package runs on post install. It works with yarn too. And you can also reverse your patch anytime.

Viraj Singh
  • 1,951
  • 1
  • 17
  • 27