简体   繁体   English

我可以更改位于node_modules文件夹下的模块中的文件吗

[英]Can i change a file located in a module under node_modules folder

Is it possible for me to make changes in a file of a module under node_modules directory (by SSHing to that stage unix box) and expect the UI to reflect the changes just be restarting that app on that box? 我是否可以在node_modules目录下的模块文件中进行更改(通过SSH到该阶段unix框),并期望UI反映出更改,而只是在该框上重新启动该应用程序? Without having to rebuild? 无需重建?

Yes it would work but I wouldn't recommend it, it would be better to fork the module and publish your own version of it to npm with the npm publish command and use your custom module instead. 是的,它可以工作,但是我不建议这样做,最好将模块分叉并使用npm publish命令将您自己的版本发布到npm,而改用您的自定义模块。 If it is a bug fix, do the above but issue a pull request while trying to honor the contribution guidelines. 如果是错误修复,请执行上述操作,但在尝试遵守贡献准则时发出请求请求。

That is unless you are using a bundling tool that minifies and compiles the js modules to one file, in this case you would have to rebuild with the bundling tool you are using such as webpack, a grunt script etc. 除非您使用的捆绑工具将js模块最小化并将其编译为一个文件,否则在这种情况下,您将不得不使用捆绑工具(例如webpack,grunt脚本等)进行重建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM