Allow defining the moduleIds-related option in the transform p… (#11194)

* Update "moduleIds" tests

* Allow defining the moduleIds related options in the transform plugins

- moduleIds
- moduleId
- getModuleId
- moduleRoot

* Sort deps
This commit is contained in:
Nicolò Ribaudo
2020-03-16 23:58:04 +01:00
committed by GitHub
parent 3ce7c2e394
commit a875560c31
52 changed files with 342 additions and 71 deletions

View File

@@ -6,6 +6,7 @@ import {
buildNamespaceInitStatements,
ensureStatementsHoisted,
wrapInterop,
getModuleName,
} from "@babel/helper-module-transforms";
import simplifyAccess from "@babel/helper-simple-access";
import { template, types as t } from "@babel/core";
@@ -161,7 +162,7 @@ export default declare((api, options) => {
});
}
let moduleName = this.getModuleName();
let moduleName = getModuleName(this.file.opts, options);
if (moduleName) moduleName = t.stringLiteral(moduleName);
const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(