File tree 4 files changed +18
-3
lines changed
4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,7 @@ export default {
304
304
};
305
305
```
306
306
307
- You can pass more options to ` giget: {} ` in layer config.
307
+ You can pass more options to ` giget: {} ` in layer config or disable it by setting it to ` false ` .
308
308
309
309
Refer to [ unjs/giget] ( https://giget.unjs.io ) for more information.
310
310
Original file line number Diff line number Diff line change @@ -302,7 +302,10 @@ async function resolveConfig<
302
302
const _merger = options . merger || defu ;
303
303
304
304
// Download giget URIs and resolve to local path
305
- if ( GIGET_PREFIXES . some ( ( prefix ) => source . startsWith ( prefix ) ) ) {
305
+ if (
306
+ options . giget !== false &&
307
+ GIGET_PREFIXES . some ( ( prefix ) => source . startsWith ( prefix ) )
308
+ ) {
306
309
const { downloadTemplate } = await import ( "giget" ) ;
307
310
308
311
const cloneName =
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ export interface LoadConfigOptions<
131
131
jiti ?: Jiti ;
132
132
jitiOptions ?: JitiOptions ;
133
133
134
- giget ?: DownloadTemplateOptions ;
134
+ giget ?: false | DownloadTemplateOptions ;
135
135
136
136
merger ?: ( ...sources : Array < T | null | undefined > ) => T ;
137
137
Original file line number Diff line number Diff line change @@ -233,6 +233,14 @@ describe("loader", () => {
233
233
extends : [ "github:unjs/c12/test/fixture" ] ,
234
234
} ,
235
235
} ) ;
236
+ const { config : nonExtendingConfig } = await loadConfig ( {
237
+ name : "test" ,
238
+ cwd : r ( "./fixture/new_dir" ) ,
239
+ giget : false ,
240
+ overrides : {
241
+ extends : [ "github:unjs/c12/test/fixture" ] ,
242
+ } ,
243
+ } ) ;
236
244
237
245
expect ( transformPaths ( config ! ) ) . toMatchInlineSnapshot ( `
238
246
{
@@ -258,6 +266,10 @@ describe("loader", () => {
258
266
"theme": "./theme",
259
267
}
260
268
` ) ;
269
+
270
+ expect ( transformPaths ( nonExtendingConfig ! ) ) . toMatchInlineSnapshot ( `
271
+ {}
272
+ ` ) ;
261
273
} ) ;
262
274
263
275
it ( "omit$Keys" , async ( ) => {
You can’t perform that action at this time.
0 commit comments