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:
committed by
Nicolò Ribaudo
parent
3c11a4a930
commit
123fdfd314
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user