Skip to content

Commit

Permalink
chore: update build
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 11, 2022
1 parent 66ecf34 commit d143012
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 24 deletions.
2 changes: 0 additions & 2 deletions esbuild.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions nuxt.d.ts

This file was deleted.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"funding": "https://github.com/sponsors/antfu",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "index.d.ts",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
Expand Down Expand Up @@ -53,14 +53,21 @@
"dist",
"*.d.ts"
],
"typesVersions": {
"*": {
"*": [
"./dist/*"
]
}
},
"scripts": {
"build": "tsup src/*.ts && esno scripts/postbuild.ts",
"dev": "tsup src/*.ts --watch src",
"build": "tsup && esno scripts/postbuild.ts",
"dev": "tsup --watch src",
"example:build": "npm -C examples/vite-vue3 run build",
"example:dev": "npm -C examples/vite-vue3 run dev",
"prepublishOnly": "npm run build",
"lint": "eslint .",
"release": "npx bumpp --commit --tag --push",
"release": "bumpp --commit --tag --push",
"test": "vitest",
"test:update": "vitest --u"
},
Expand Down
2 changes: 0 additions & 2 deletions resolvers.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions rollup.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion scripts/postbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ async function run() {
code = code.replace('exports.default =', 'module.exports =')
code += 'exports.default = module.exports;'
await fs.writeFile(file, code)
await fs.writeFile(`${name}.d.ts`, `export * from './dist/${name}'\nexport { default } from './dist/${name}'\n`)
}
}

Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"compilerOptions": {
"target": "es2017",
"module": "esnext",
"target": "es2019",
"lib": ["esnext", "DOM"],
"lib": ["esnext"],
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"strictNullChecks": true,
"moduleResolution": "node",
"resolveJsonModule": true
}
}
4 changes: 4 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import type { Options } from 'tsup'

export const tsup: Options = {
entry: [
'src/*.ts',
],
format: ['cjs', 'esm'],
dts: true,
splitting: true,
clean: true,
shims: false,
}
2 changes: 0 additions & 2 deletions types.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions vite.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions webpack.d.ts

This file was deleted.

0 comments on commit d143012

Please sign in to comment.