mirror of
https://github.com/acamarata/solar-spa.git
synced 2026-06-30 19:04:28 +00:00
- Trim README to ≤80 lines with wiki link for full docs - Add CHANGELOG.md with initial entry - Fix CI: replace pinned pnpm/action-setup with corepack enable - Add "type": "module" and flat exports map (ADR-015) - Add ./package.json exports entry - Add coverage script - Rename wasm/spa-module.js → wasm/spa-module.cjs to fix CJS/ESM conflict - Update src/index.ts and tsup.config.ts to reference spa-module.cjs - Add .github/wiki pages: _Sidebar, _Footer, SECURITY, CODE_OF_CONDUCT
28 lines
666 B
TypeScript
28 lines
666 B
TypeScript
import { defineConfig } from 'tsup';
|
|
|
|
export default defineConfig({
|
|
entry: ['src/index.ts'],
|
|
format: ['cjs', 'esm'],
|
|
dts: true,
|
|
clean: true,
|
|
outDir: 'dist',
|
|
splitting: false,
|
|
sourcemap: true,
|
|
target: 'es2020',
|
|
platform: 'node',
|
|
outExtension({ format }) {
|
|
return {
|
|
js: format === 'cjs' ? '.cjs' : '.mjs',
|
|
};
|
|
},
|
|
banner({ format }) {
|
|
if (format === 'esm') {
|
|
return {
|
|
js: `import { createRequire as __cr } from 'node:module';\nconst __require = __cr(import.meta.url);`,
|
|
};
|
|
}
|
|
return {};
|
|
},
|
|
// The WASM module is Emscripten CJS output, keep it external.
|
|
external: ['../wasm/spa-module.cjs'],
|
|
});
|