@graphql-codegen/cli 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/codegen.js +11 -6
- package/esm/codegen.js +11 -6
- package/package.json +1 -1
package/cjs/codegen.js
CHANGED
|
@@ -271,17 +271,22 @@ async function executeCodegen(input) {
|
|
|
271
271
|
const name = Object.keys(plugin)[0];
|
|
272
272
|
return [name, pkg];
|
|
273
273
|
}));
|
|
274
|
-
const
|
|
274
|
+
const rawMergedConfig = {
|
|
275
|
+
...rootConfig,
|
|
275
276
|
emitLegacyCommonJSImports: config.emitLegacyCommonJSImports,
|
|
276
277
|
importExtension: config.importExtension,
|
|
277
|
-
});
|
|
278
|
-
const mergedConfig = {
|
|
279
|
-
...rootConfig,
|
|
280
278
|
...(typeof outputFileTemplateConfig === 'string'
|
|
281
279
|
? { value: outputFileTemplateConfig }
|
|
282
280
|
: outputFileTemplateConfig),
|
|
281
|
+
};
|
|
282
|
+
const importExtension = (0, plugin_helpers_1.normalizeImportExtension)({
|
|
283
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports,
|
|
284
|
+
importExtension: rawMergedConfig.importExtension,
|
|
285
|
+
});
|
|
286
|
+
const mergedConfig = {
|
|
287
|
+
...rawMergedConfig,
|
|
283
288
|
importExtension,
|
|
284
|
-
emitLegacyCommonJSImports:
|
|
289
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports ?? true,
|
|
285
290
|
};
|
|
286
291
|
const documentTransforms = Array.isArray(outputConfig.documentTransforms)
|
|
287
292
|
? await Promise.all(outputConfig.documentTransforms.map(async (config, index) => {
|
|
@@ -320,7 +325,7 @@ async function executeCodegen(input) {
|
|
|
320
325
|
const output = await (0, core_1.codegen)({
|
|
321
326
|
...outputArgs,
|
|
322
327
|
importExtension,
|
|
323
|
-
emitLegacyCommonJSImports:
|
|
328
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports ?? true,
|
|
324
329
|
cache,
|
|
325
330
|
});
|
|
326
331
|
result.push({
|
package/esm/codegen.js
CHANGED
|
@@ -267,17 +267,22 @@ export async function executeCodegen(input) {
|
|
|
267
267
|
const name = Object.keys(plugin)[0];
|
|
268
268
|
return [name, pkg];
|
|
269
269
|
}));
|
|
270
|
-
const
|
|
270
|
+
const rawMergedConfig = {
|
|
271
|
+
...rootConfig,
|
|
271
272
|
emitLegacyCommonJSImports: config.emitLegacyCommonJSImports,
|
|
272
273
|
importExtension: config.importExtension,
|
|
273
|
-
});
|
|
274
|
-
const mergedConfig = {
|
|
275
|
-
...rootConfig,
|
|
276
274
|
...(typeof outputFileTemplateConfig === 'string'
|
|
277
275
|
? { value: outputFileTemplateConfig }
|
|
278
276
|
: outputFileTemplateConfig),
|
|
277
|
+
};
|
|
278
|
+
const importExtension = normalizeImportExtension({
|
|
279
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports,
|
|
280
|
+
importExtension: rawMergedConfig.importExtension,
|
|
281
|
+
});
|
|
282
|
+
const mergedConfig = {
|
|
283
|
+
...rawMergedConfig,
|
|
279
284
|
importExtension,
|
|
280
|
-
emitLegacyCommonJSImports:
|
|
285
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports ?? true,
|
|
281
286
|
};
|
|
282
287
|
const documentTransforms = Array.isArray(outputConfig.documentTransforms)
|
|
283
288
|
? await Promise.all(outputConfig.documentTransforms.map(async (config, index) => {
|
|
@@ -316,7 +321,7 @@ export async function executeCodegen(input) {
|
|
|
316
321
|
const output = await codegen({
|
|
317
322
|
...outputArgs,
|
|
318
323
|
importExtension,
|
|
319
|
-
emitLegacyCommonJSImports:
|
|
324
|
+
emitLegacyCommonJSImports: rawMergedConfig.emitLegacyCommonJSImports ?? true,
|
|
320
325
|
cache,
|
|
321
326
|
});
|
|
322
327
|
result.push({
|