@@ -104,6 +104,11 @@ function getFramework(): prompt.Choice[] {
104104 value : 'marko' ,
105105 description : '"A declarative, HTML-based language that makes building web apps fun"' ,
106106 } ,
107+ {
108+ title : 'qwik' ,
109+ value : 'qwik' ,
110+ description : '"Instantly interactive web apps at scale"' ,
111+ } ,
107112 ]
108113}
109114
@@ -125,6 +130,8 @@ function getFrameworkTestPackage(framework: string) {
125130 return '@solidjs/testing-library'
126131 case 'marko' :
127132 return '@marko/testing-library'
133+ case 'qwik' :
134+ return 'vitest-browser-qwik'
128135 }
129136 throw new Error ( `Unsupported framework: ${ framework } ` )
130137}
@@ -143,6 +150,8 @@ function getFrameworkPluginPackage(framework: string) {
143150 return 'vite-plugin-solid'
144151 case 'marko' :
145152 return '@marko/vite'
153+ case 'qwik' :
154+ return '@builder.io/qwik/optimizer'
146155 }
147156 return null
148157}
@@ -224,6 +233,9 @@ function getPossibleFramework(dependencies: Record<string, string>) {
224233 if ( dependencies . marko ) {
225234 return 'marko'
226235 }
236+ if ( dependencies [ '@builder.io/qwik' ] || dependencies [ '@qwik.dev/core' ] ) {
237+ return 'qwik'
238+ }
227239 return 'vanilla'
228240}
229241
@@ -257,22 +269,36 @@ function fail() {
257269 process . exitCode = 1
258270}
259271
272+ function getFrameworkImportInfo ( framework : string ) {
273+ switch ( framework ) {
274+ case 'svelte' :
275+ return { importName : 'svelte' , isNamedExport : true }
276+ case 'qwik' :
277+ return { importName : 'qwikVite' , isNamedExport : true }
278+ default :
279+ return { importName : framework , isNamedExport : false }
280+ }
281+ }
282+
260283async function generateFrameworkConfigFile ( options : {
261284 configPath : string
262285 framework : string
263286 frameworkPlugin : string | null
264287 provider : string
265288 browsers : string [ ]
266289} ) {
267- const frameworkImport = options . framework === 'svelte'
268- ? `import { svelte } from '${ options . frameworkPlugin } '`
269- : `import ${ options . framework } from '${ options . frameworkPlugin } '`
290+ const { importName, isNamedExport } = getFrameworkImportInfo ( options . framework )
291+
292+ const frameworkImport = isNamedExport
293+ ? `import { ${ importName } } from '${ options . frameworkPlugin } '`
294+ : `import ${ importName } from '${ options . frameworkPlugin } '`
295+
270296 const configContent = [
271297 `import { defineConfig } from 'vitest/config'` ,
272298 options . frameworkPlugin ? frameworkImport : null ,
273299 `` ,
274300 'export default defineConfig({' ,
275- options . frameworkPlugin ? ` plugins: [${ options . framework } ()],` : null ,
301+ options . frameworkPlugin ? ` plugins: [${ importName } ()],` : null ,
276302 ` test: {` ,
277303 ` browser: {` ,
278304 ` enabled: true,` ,
0 commit comments