[英]how to access package in public folder from node_modules folder in nodejs?
i have MEAN stack
application. 我有
MEAN stack
应用程序。 In public folder i have AngularJs
application. 在公用文件夹中,我有
AngularJs
应用程序。
Structure 结构体
Here in index.html
i am trying to access a package, which is present in node_modules
. 我在
index.html
尝试访问一个包,该包位于node_modules
。
Can any please tell me how to access this? 可以请告诉我如何访问吗?
As @31Py said, you can reference using ../node_modules/path/to/the/package
正如@ 31Py所说,您可以使用
../node_modules/path/to/the/package
进行引用
OR 要么
It's always better to create separate dependencies in package.json
file for public folder(front end code). 最好在
package.json
文件中为公用文件夹(前端代码)创建单独的依赖项。 This helps you to organize both the code separate, while bundling front end, running task runners(grunt, gulp) and you would know which packages are for front end. 这有助于您将两个代码分开组织,同时捆绑前端,运行任务运行程序(grunt,gulp),并且您会知道哪些软件包用于前端。
In index.html referencing the node modules will be /node_modules/path/to/the/package
在index.html中,引用的节点模块将是
/node_modules/path/to/the/package
Some reference Links with comments in the section. 本节中一些带有注释的参考链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.