Skip to content

Commit

Permalink
chore: backup目录使用脚本创建
Browse files Browse the repository at this point in the history
  • Loading branch information
geekact committed Jul 21, 2024
1 parent eb9fe0e commit 2680063
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"test": "vitest",
"generate": "aomex openapi-yaml && aomex openapi-json",
"build": "tsup",
"build": "tsup && sh scripts/build-success.sh",
"prepare": "husky",
"prepublishOnly": "pnpm build",
"deploy:main": "sh scripts/develop-deploy-main.sh",
Expand Down
10 changes: 10 additions & 0 deletions scripts/build-success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh

set -ex

echo '{"type":"module"}' > dist/esm/package.json

mkdir -p backup/esm
cp dist/index.js backup/index.js
cp dist/index.d.ts backup/index.d.ts
cp dist/esm/index.js backup/esm/index.js
15 changes: 0 additions & 15 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@ export default defineConfig([
shims: false,
dts: true,
legacyOutput: true,
onSuccess: `echo '{"type":"module"}' > dist/esm/package.json`,
},
{
entry: ['src/index.ts'],
outDir: './backup',
splitting: false,
sourcemap: false,
clean: false,
format: ['cjs', 'esm'],
platform: 'node',
tsconfig: './tsconfig.json',
target: 'es2020',
shims: false,
dts: true,
legacyOutput: true,
},
{
entry: readdirSync(path.resolve('src', 'adapters')).map(
Expand Down

0 comments on commit 2680063

Please sign in to comment.