【发布时间】:2017-01-11 21:31:15
【问题描述】:
我目前正在使用节点 npm 来管理前端的 jquery 等依赖项。使用以下方法。
服务器(工作)
app.use('/jquery', express.static(__dirname + '/node_modules/jquery/dist/'));
客户(工作)
<script src="/jquery/jquery.js"></script>
这可行,但我也希望能够从服务器端管理依赖项“three.js”。有点像...
服务器(不工作)
app.use('/three', express.static(__dirname + '/node_modules/three/dist/'));
客户端(不工作)
<script src="/three/three.js"></script>
错误()
加载资源失败,服务器响应状态为 404(未找到)
如何找到 npm 模块的目录结构?
【问题讨论】:
标签: javascript node.js npm three.js