【发布时间】:2017-01-15 20:35:49
【问题描述】:
我正在使用根 (http://roots.cx),我想在我的页面中包含来自 node_module 的库。我有npm install foo,图书馆在磁盘上。
我尝试将foo 添加到 app.coffee 中的extensions 并重新启动观察程序,但它呈现的路径是浏览器无法解析的 node_modules 文件夹。
extensions: [
js_pipeline(files: 'node_modules/foo/lib/foo.js', 'assets/js/*.coffee'),
css_pipeline(files: 'assets/css/*.styl')
]
在页面源代码中我得到了
<script src='node_modules/foo/lib/foo.js'></script>
从节点模块中包含库的正确方法是什么?
【问题讨论】:
标签: javascript node.js roots-toolkit