File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as path from 'node:path';
33import { fileURLToPath } from 'node:url' ;
44import glob from 'tiny-glob/sync.js' ;
55import minimist from 'minimist' ;
6- import { compile , compileModule } from 'svelte/compiler' ;
6+ import { compile , compileModule , parse } from 'svelte/compiler' ;
77
88const argv = minimist ( process . argv . slice ( 2 ) ) ;
99
@@ -49,6 +49,14 @@ for (const generate of ['client', 'server']) {
4949 if ( compiled . css ) {
5050 fs . writeFileSync ( output_css , compiled . css . code ) ;
5151 }
52+
53+ if ( generate === 'client' ) {
54+ const ast = parse ( source , {
55+ modern : true
56+ } ) ;
57+
58+ fs . writeFileSync ( `${ cwd } /output/${ file } .json` , JSON . stringify ( ast , null , '\t' ) ) ;
59+ }
5260 }
5361
5462 for ( const file of js_modules ) {
You can’t perform that action at this time.
0 commit comments