Skip to content

Commit

Permalink
feat: support cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Mar 31, 2023
1 parent e2d074f commit 17e390a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"debug": "^4.3.4",
"esbuild": "^0.17.12",
"fs-extra": "^11.1.1",
"on-change": "^4.0.2",
"tiny-glob": "^0.2.9",
"watcher": "^2.2.2"
"tiny-glob": "^0.2.9"
},
"devDependencies": {
"@minko-fe/eslint-config": "^1.2.31",
Expand All @@ -63,9 +61,11 @@
"conventional-changelog-cli": "^2.2.2",
"eslint": "^8.36.0",
"mock-fs": "^5.2.0",
"on-change": "^4.0.2",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"vite": "^4.2.1",
"vitest": "^0.29.7"
"vitest": "^0.29.7",
"watcher": "^2.2.2"
}
}
5 changes: 5 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export const tsup = defineConfig((option) => ({
platform: 'node',
sourcemap: !!option.watch,
tsconfig: option.watch ? './tsconfig.dev.json' : './tsconfig.json',
esbuildOptions(opts, { format }) {
if (format === 'esm') {
opts.external = ['watcher', 'on-change']
}
},
}))

0 comments on commit 17e390a

Please sign in to comment.