Fix lazy option of babel-plugin-transform-modules-commonjs (#9802)

* Fix lazy mode of babel-plugin-transform-modules-commonjs (#9447)

* Update output snapshots for lazy mode of babel-plugin-transform-modules-commonjs (#9447)
This commit is contained in:
Andrew Anikin
2019-04-01 08:59:12 +03:00
committed by Nicolò Ribaudo
parent 3c11a4a930
commit 123fdfd314
7 changed files with 45 additions and 38 deletions

View File

@@ -288,7 +288,7 @@ function getModuleMetadata(
// dependency modules are loaded lazily.
metadata.lazy = !/\./.test(source);
} else if (Array.isArray(lazy)) {
metadata.lazy = lazy.indexOf(source);
metadata.lazy = lazy.indexOf(source) !== -1;
} else if (typeof lazy === "function") {
metadata.lazy = lazy(source);
} else {