Skip to content

Commit

Permalink
chore: switch to unbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 1, 2022
1 parent b8225bd commit 135a5f1
Show file tree
Hide file tree
Showing 5 changed files with 1,143 additions and 322 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

14 changes: 14 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineBuildConfig } from 'unbuild'
import fg from 'fast-glob'

export default defineBuildConfig({
entries: [
...fg.sync('src/commands/*.ts').map(i => i.slice(0, -3)),
],
clean: true,
declaration: true,
rollup: {
emitCJS: true,
inlineDependencies: true,
},
})
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
"type": "git",
"url": "git+https://github.com/antfu/ni.git"
},
"main": "dist/index.js",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist",
"bin"
],
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"bin": {
"ni": "bin/ni.mjs",
"nci": "bin/nci.mjs",
Expand All @@ -30,33 +36,33 @@
"homepage": "https://github.com/antfu/ni#readme",
"scripts": {
"prepublishOnly": "npm run build",
"watch": "npm run build -- --watch",
"dev": "esno src/commands/ni.ts",
"build": "tsup",
"build": "unbuild",
"release": "npx bumpp --commit --push --tag",
"lint": "eslint .",
"test": "vitest"
},
"devDependencies": {
"@antfu/eslint-config-ts": "^0.22.0",
"@antfu/eslint-config": "^0.22.0",
"@types/ini": "^1.3.31",
"@types/node": "^17.0.30",
"@types/prompts": "^2.4.0",
"@types/which": "^2.0.1",
"eslint": "^8.14.0",
"esno": "^0.14.1",
"execa": "^6.1.0",
"fast-glob": "^3.2.11",
"find-up": "^6.3.0",
"ini": "^3.0.0",
"prompts": "^2.4.2",
"rimraf": "^3.0.2",
"terminal-link": "^3.0.0",
"tsup": "^5.12.6",
"typescript": "^4.6.4",
"unbuild": "^0.7.4",
"vitest": "^0.10.0",
"which": "^2.0.2"
},
"eslintConfig": {
"extends": "@antfu/eslint-config-ts"
"extends": "@antfu"
}
}
Loading

0 comments on commit 135a5f1

Please sign in to comment.