Skip to content

Commit dab417f

Browse files
committed
refactor: rename
1 parent 5b0b6b3 commit dab417f

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎lib/Module.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const makeSerializable = require("./util/makeSerializable");
123123
* @property {("default" | "namespace" | "flagged" | "dynamic")=} exportsType
124124
* @property {(false | "redirect" | "redirect-warn")=} defaultObject
125125
* @property {boolean=} strictHarmonyModule
126-
* @property {boolean=} treatAsCommonjs
126+
* @property {boolean=} treatAsCommonJs
127127
* @property {boolean=} async
128128
* @property {boolean=} sideEffectFree
129129
* @property {boolean=} isCSSModule

‎lib/dependencies/CommonJsExportsParserPlugin.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class CommonJsExportsParserPlugin {
219219
parser.state.module.addDependency(dep);
220220
/** @type {BuildMeta} */ (
221221
parser.state.module.buildMeta
222-
).treatAsCommonjs = true;
222+
).treatAsCommonJs = true;
223223

224224
return true;
225225
}
@@ -241,7 +241,7 @@ class CommonJsExportsParserPlugin {
241241
);
242242
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
243243
parser.state.module.addDependency(dep);
244-
/** @type {BuildMeta} */ (parser.state.module.buildMeta).treatAsCommonjs =
244+
/** @type {BuildMeta} */ (parser.state.module.buildMeta).treatAsCommonJs =
245245
true;
246246
parser.walkExpression(expr.right);
247247
return true;
@@ -302,7 +302,7 @@ class CommonJsExportsParserPlugin {
302302
parser.state.module.addDependency(dep);
303303
/** @type {BuildMeta} */ (
304304
parser.state.module.buildMeta
305-
).treatAsCommonjs = true;
305+
).treatAsCommonJs = true;
306306

307307
parser.walkExpression(expr.arguments[2]);
308308
return true;
@@ -343,7 +343,7 @@ class CommonJsExportsParserPlugin {
343343
);
344344
dep.loc = /** @type {DependencyLocation} */ (expr.loc);
345345
parser.state.module.addDependency(dep);
346-
/** @type {BuildMeta} */ (parser.state.module.buildMeta).treatAsCommonjs =
346+
/** @type {BuildMeta} */ (parser.state.module.buildMeta).treatAsCommonJs =
347347
true;
348348

349349
if (call) {

‎lib/library/ModuleLibraryPlugin.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ModuleLibraryPlugin extends AbstractLibraryPlugin {
9797
} else {
9898
const exportsInfo = moduleGraph.getExportsInfo(module);
9999
// If the entry module is commonjs, its exports cannot be mangled
100-
if (module.buildMeta && module.buildMeta.treatAsCommonjs) {
100+
if (module.buildMeta && module.buildMeta.treatAsCommonJs) {
101101
exportsInfo.setUsedInUnknownWay(runtime);
102102
} else {
103103
exportsInfo.setAllKnownExportsUsed(runtime);
@@ -169,9 +169,9 @@ class ModuleLibraryPlugin extends AbstractLibraryPlugin {
169169
const exports = [];
170170
const isAsync = moduleGraph.isAsync(module);
171171

172-
const treatAsCommonjs =
173-
module.buildMeta && module.buildMeta.treatAsCommonjs;
174-
const skipRenderDefaultExport = Boolean(treatAsCommonjs);
172+
const treatAsCommonJs =
173+
module.buildMeta && module.buildMeta.treatAsCommonJs;
174+
const skipRenderDefaultExport = Boolean(treatAsCommonJs);
175175

176176
if (isAsync) {
177177
result.add(
@@ -256,7 +256,7 @@ class ModuleLibraryPlugin extends AbstractLibraryPlugin {
256256
}
257257
}
258258

259-
if (treatAsCommonjs) {
259+
if (treatAsCommonJs) {
260260
shortHandedExports.push(`${RuntimeGlobals.exports} as default`);
261261
}
262262

‎types.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8588,7 +8588,7 @@ declare interface KnownBuildMeta {
85888588
exportsType?: "namespace" | "dynamic" | "default" | "flagged";
85898589
defaultObject?: false | "redirect" | "redirect-warn";
85908590
strictHarmonyModule?: boolean;
8591-
treatAsCommonjs?: boolean;
8591+
treatAsCommonJs?: boolean;
85928592
async?: boolean;
85938593
sideEffectFree?: boolean;
85948594
isCSSModule?: boolean;

0 commit comments

Comments
 (0)