Skip to content

Commit

Permalink
更新包为 CommonJS 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoranner committed May 14, 2024
1 parent 2dc4239 commit 13a2bbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions es-build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import esbuild from 'esbuild';
import { globby } from 'globby';
const esbuild = require('esbuild');

(async () => {
const globby = (await import('globby')).globby;
const entryPoints = await globby(['src/**/*.ts', '!src/**/*.spec.ts']);

esbuild
Expand All @@ -11,7 +11,7 @@ import { globby } from 'globby';
bundle: false,
platform: 'node',
target: 'es6',
format: 'esm',
format: 'cjs',
tsconfig: 'tsconfig.json'
})
.catch(() => process.exit(1));
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "duan-hub-sdk",
"version": "0.0.7",
"version": "0.0.8",
"description": "DuanHub SDK",
"author": "Zoranner",
"license": "MIT",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": ">=18"
},
"scripts": {
"format": "prettier --write --parser=typescript src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"module": "CommonJS",
"sourceMap": true,
"declaration": true,
"outDir": "./dist",
Expand Down

0 comments on commit 13a2bbf

Please sign in to comment.