|
|
@ -3,7 +3,7 @@ import * as path from 'node:path';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import glob from 'tiny-glob/sync.js';
|
|
|
|
import glob from 'tiny-glob/sync.js';
|
|
|
|
import minimist from 'minimist';
|
|
|
|
import minimist from 'minimist';
|
|
|
|
import { compile, compileModule } from 'svelte/compiler';
|
|
|
|
import { compile, compileModule, parse } from 'svelte/compiler';
|
|
|
|
|
|
|
|
|
|
|
|
const argv = minimist(process.argv.slice(2));
|
|
|
|
const argv = minimist(process.argv.slice(2));
|
|
|
|
|
|
|
|
|
|
|
@ -49,6 +49,14 @@ for (const generate of ['client', 'server']) {
|
|
|
|
if (compiled.css) {
|
|
|
|
if (compiled.css) {
|
|
|
|
fs.writeFileSync(output_css, compiled.css.code);
|
|
|
|
fs.writeFileSync(output_css, compiled.css.code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (generate === 'client') {
|
|
|
|
|
|
|
|
const ast = parse(source, {
|
|
|
|
|
|
|
|
modern: true
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fs.writeFileSync(`${cwd}/output/${file}.json`, JSON.stringify(ast, null, '\t'));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (const file of js_modules) {
|
|
|
|
for (const file of js_modules) {
|
|
|
|