Skip to content

Commit

Permalink
feat: support cjs format
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Dec 20, 2023
1 parent e09c88c commit 2c135f3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"root": true,
"extends": ["@varlet"],
"ignorePatterns": ["node_modules", "es", "dist", "playground"]
"ignorePatterns": ["node_modules", "es", "cjs", "lib", "dist", "playground"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package-lock.json

lib
es
cjs
site
auto-imports.d.ts
components.d.ts
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package.json
*.md
.github/**
.history/**
lib/**
es/**
cjs/**

pnpm-lock.yaml
pnpm-workspace.yaml
33 changes: 16 additions & 17 deletions packages/axle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
"version": "0.3.2",
"description": "Progressive request tool based on axios",
"type": "module",
"main": "es/index.js",
"module": "es/index.js",
"types": "index.d.ts",
"typesVersions": {
"*": {
"*": [
"./es/*"
]
}
},
"main": "lib/index.cjs",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./es/index.js",
"./use": "./es/use.js",
".": {
"import": "./lib/index.js",
"require": "./lib/index.cjs",
"types": "./lib/index.d.ts"
},
"./use": {
"import": "./lib/use.js",
"require": "./lib/use.cjs",
"types": "./lib/use.d.ts"
},
"./*": "./*"
},
"files": [
"es"
],
"files": ["lib"],
"keywords": [
"axle",
"axios",
Expand All @@ -31,8 +30,8 @@
"author": "haoziqaq <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "tsup src/index.ts src/use.ts --format esm --out-dir=es --watch --dts",
"build": "tsup src/index.ts src/use.ts --format esm --out-dir=es --dts --clean"
"dev": "tsup src/index.ts src/use.ts --format esm --out-dir=lib --watch --dts",
"build": "tsup src/index.ts src/use.ts --format esm,cjs --out-dir=lib --dts --clean"
},
"dependencies": {
"@types/crypto-js": "^4.2.1",
Expand Down

0 comments on commit 2c135f3

Please sign in to comment.