File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,21 @@ const production = !process.env.ROLLUP_WATCH;
3434
3535// get quarto project output directory and list of inputs
3636// const quartoOutDir = process.env.QUARTO_PROJECT_OUTPUT_DIR;
37- const quartoOutDir = fs . readFileSync ( '.sverto/.sverto-outdir' , 'utf8' )
38- const svelteFiles = fs . readFileSync ( '.sverto/.sverto-imports' , 'utf8' )
37+ const quartoOutDir = fs . readFileSync ( '.sverto/.sverto-outdir' , 'utf8' ) ;
38+
39+ let svelteConfig = { } ;
40+ const svelteImportListPath = '.sverto/.sverto-imports' ;
41+
42+ // skip svelte compilation if there's nothing to compile
43+ if ( ! fs . existsSync ( svelteImportListPath ) ) {
44+ console . log ( "ℹ No Svelte imports to process; skipping compilation" ) ;
45+ process . exit ( ) ;
46+ }
47+
48+ // get the list of unique imports to compile
49+ const svelteFiles = fs . readFileSync ( svelteImportListPath , 'utf8' )
3950 . split ( "\n" )
4051 . filter ( d => d !== "" ) ;
41-
42- // remove duplicate svelte components (being used by several qmds)
4352const uniqueSvelteFiles = [ ... new Set ( svelteFiles ) ]
4453
4554// we export an array of rollup configs: one for each input svelte file
You can’t perform that action at this time.
0 commit comments