Fix ?module bug with empty filenames

This commit is contained in:
MICHAEL JACKSON 2017-08-26 17:44:29 -07:00
parent e95dcf0028
commit 50979bfca5
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ function fetchFile(req, res, next) {
if (req.query.module != null) {
// They want an ES module. Try "module", "jsnext:main", and "/"
// https://github.com/rollup/rollup/wiki/pkg.module
if (filename == null)
if (!filename)
filename = req.packageConfig.module || req.packageConfig['jsnext:main'] || '/'
} else if (filename) {
// They are requesting an explicit filename. Only try to find an