Skip to content

Commit

Permalink
feat: add cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed May 6, 2023
1 parent f99f5cb commit b32df53
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 40 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ jobs:
with:
version: 8

- run: pnpm i -g @antfu/ni

- name: Release and Publish
run: nlx lvr release & (nci && pnpm publish --no-git-checks)
run: pnpm dlx lvr release & (pnpm i && pnpm publish --no-git-checks)
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"scripts": {
"test": "vitest",
"release": "lvr --no-push",
"prepublishOnly": "pnpm test"
"build:cjs": "pnpm dlx tsup ./index.mjs -d=./",
"prepublishOnly": "pnpm test && pnpm build:cjs"
},
"main": "index.mjs",
"main": "index.cjs",
"module": "index.mjs",
"types": "index.d.ts",
"author": "lvjiaxuan <471501748@qq.com> (https://github.com/lvjiaxuan)",
"license": "MIT",
Expand All @@ -21,9 +23,9 @@
"url": "https://github.com/lvjiaxuan/unocss-transformer-attribute-values-group"
},
"devDependencies": {
"@unocss/core": "^0.51.8",
"@unocss/core": "^0.51.12",
"jest": "^29.5.0",
"vitest": "^0.30.1"
"vitest": "^0.31.0"
},
"dependencies": {
"magic-string": "^0.30.0"
Expand Down
65 changes: 32 additions & 33 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions tsup.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
outExtension({ format }) {
return {
js: {
cjs: '.cjs',
esm: '.mjs',
iife: '.js'
}[format]
}
}
}

0 comments on commit b32df53

Please sign in to comment.