-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(moduletypes): introduce module type constants, reduce memory…
… footprint define/json plugins
- Loading branch information
1 parent
d96ce76
commit 844fc55
Showing
3 changed files
with
82 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @type {Readonly<"javascript/auto">} | ||
*/ | ||
const JAVASCRIPT_MODULE_TYPE_AUTO = "javascript/auto"; | ||
/** | ||
* @type {Readonly<"javascript/dynamic">} | ||
*/ | ||
const JAVASCRIPT_MODULE_TYPE_DYNAMIC = "javascript/dynamic"; | ||
/** | ||
* @type {Readonly<"javascript/esm">} | ||
* This is the module type used for _strict_ ES Module syntax. This means that all legacy formats | ||
* that webpack supports (CommonJS, AMD, SystemJS) are not supported. | ||
*/ | ||
const JAVASCRIPT_MODULE_TYPE_ESM = "javascript/esm"; | ||
|
||
/** | ||
* @type {Readonly<"json">} | ||
* This is the module type used for JSON files. JSON files are always parsed as ES Module. | ||
*/ | ||
const JSON_MODULE_TYPE = "json"; | ||
|
||
exports.JAVASCRIPT_MODULE_TYPE_AUTO = JAVASCRIPT_MODULE_TYPE_AUTO; | ||
exports.JAVASCRIPT_MODULE_TYPE_DYNAMIC = JAVASCRIPT_MODULE_TYPE_DYNAMIC; | ||
exports.JAVASCRIPT_MODULE_TYPE_ESM = JAVASCRIPT_MODULE_TYPE_ESM; | ||
exports.JSON_MODULE_TYPE = JSON_MODULE_TYPE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters