我正在使用npm和express.js,并希望使用npm来管理我的前端依赖。
我在app.js
中这样做app.use( express.static('./') );
app.use('/scripts', express.static(__dirname + '/node_modules/fabric/dist/'));
所以我可以在前端使用<script src="/scripts/fabric.js"></script>
。
如何让它对所有脚本动态化?就像我有jquery我必须这样做
app.use('/scripts', express.static(__dirname + '/node_modules/jquery/dist/'));
?
我希望我能做到app.use('/scripts', express.static(__dirname + '/node_modules/*/dist/'));