| | |
| | | JAVASCRIPT_MODULE_TYPE_AUTO, |
| | | JAVASCRIPT_MODULE_TYPE_ESM |
| | | } = require("../ModuleTypeConstants"); |
| | | const CreateRequireParserPlugin = require("./CreateRequireParserPlugin"); |
| | | const HarmonyAcceptDependency = require("./HarmonyAcceptDependency"); |
| | | const HarmonyAcceptImportDependency = require("./HarmonyAcceptImportDependency"); |
| | | const HarmonyCompatibilityDependency = require("./HarmonyCompatibilityDependency"); |
| | |
| | | /** @typedef {import("../javascript/JavascriptParser")} Parser */ |
| | | |
| | | /** |
| | | * Defines the harmony modules plugin options type used by this module. |
| | | * @typedef {object} HarmonyModulesPluginOptions |
| | | * @property {boolean=} deferImport |
| | | */ |
| | |
| | | |
| | | class HarmonyModulesPlugin { |
| | | /** |
| | | * Creates an instance of HarmonyModulesPlugin. |
| | | * @param {HarmonyModulesPluginOptions} options options |
| | | */ |
| | | constructor(options) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | ); |
| | | |
| | | /** |
| | | * Handles the hook callback for this code path. |
| | | * @param {Parser} parser parser parser |
| | | * @param {JavascriptParserOptions} parserOptions parserOptions |
| | | * @returns {void} |
| | |
| | | new HarmonyImportDependencyParserPlugin(parserOptions).apply(parser); |
| | | new HarmonyExportDependencyParserPlugin(parserOptions).apply(parser); |
| | | new HarmonyTopLevelThisParserPlugin().apply(parser); |
| | | if (parserOptions.createRequire) { |
| | | new CreateRequireParserPlugin(parserOptions).apply(parser); |
| | | } |
| | | }; |
| | | |
| | | normalModuleFactory.hooks.parser |