Using a custom node module with CI

Hi Netlify team,

I want to use the CI deployment with my Github as I always have. But, there is one package, Fabric.js, that requires that I modify files in the dist folder of fabric fold in node_modules. This is necessary in order to unlock some touch gesture functionality.

So, when I build and deploy locally, everything works as expected. However, when I deploy through CI, there is no way for Netlify to know that I’ve replaced/modified some files in a node package and therefore changes are not reflected in my build. Is there a solution to this?

Thank you as always.

You can write a custom Node.js or bash script to modify the files as needed OR you can save the modified files somewhere in your repo and use the cp command. Either of this should happen before your build command.

For example, if you choose the cp command method and your build command is npm run build, you can change the build command to: cp <args> && npm run build.

You can also leverage a custom Netlify build plugin for this:

Thank you!! I’ll try this out. I really appreciate the help.