refactor(export): built-in package for assets export

1. use built-in assets package to support html export
2. improve markdown export
This commit is contained in:
mingholy.lmh 2026-01-29 15:18:56 +08:00
parent a4630d39e4
commit 86a43618a7
16 changed files with 819 additions and 405 deletions

View file

@ -0,0 +1,27 @@
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
const assetsDir = dirname(fileURLToPath(import.meta.url));
const srcDir = join(assetsDir, 'src');
export const buildConfig = {
entryPoints: [join(srcDir, 'main.tsx')],
bundle: true,
minify: true,
write: false,
outdir: join(assetsDir, 'dist'),
platform: 'browser',
format: 'iife',
target: ['es2018'],
jsx: 'automatic',
legalComments: 'none',
loader: {
'.ts': 'ts',
'.tsx': 'tsx',
'.js': 'jsx',
'.jsx': 'jsx',
'.css': 'css',
'.svg': 'text',
},
};