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';
3
3
import { fileURLToPath } from 'node:url' ;
4
4
import glob from 'tiny-glob/sync.js' ;
5
5
import minimist from 'minimist' ;
6
- import { compile , compileModule } from 'svelte/compiler' ;
6
+ import { compile , compileModule , parse } from 'svelte/compiler' ;
7
7
8
8
const argv = minimist ( process . argv . slice ( 2 ) ) ;
9
9
@@ -49,6 +49,14 @@ for (const generate of ['client', 'server']) {
49
49
if ( compiled . css ) {
50
50
fs . writeFileSync ( output_css , compiled . css . code ) ;
51
51
}
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
+ }
52
60
}
53
61
54
62
for ( const file of js_modules ) {
You can’t perform that action at this time.
0 commit comments