Skip to content

Commit

Permalink
feat: enable usage in both CommonJS and ESM environments
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Dec 18, 2024
1 parent 6f109f9 commit 0e6b68e
Show file tree
Hide file tree
Showing 16 changed files with 369 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ node_modules/

# package output directory
dist/

# tshy build output
.tshy-build/
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Auto-generated
docs/API.md
CHANGELOG.md
CHANGELOG.md
.tshy/
.tshy-build/
8 changes: 8 additions & 0 deletions .tshy/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.build.json",
"compilerOptions": {
"rootDir": "../src",
"module": "nodenext",
"moduleResolution": "nodenext"
}
}
16 changes: 16 additions & 0 deletions .tshy/commonjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./build.json",
"include": [
"../src/**/*.ts",
"../src/**/*.cts",
"../src/**/*.tsx",
"../src/**/*.json"
],
"exclude": [
"../src/**/*.mts",
"../src/package.json"
],
"compilerOptions": {
"outDir": "../.tshy-build/commonjs"
}
}
15 changes: 15 additions & 0 deletions .tshy/esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "./build.json",
"include": [
"../src/**/*.ts",
"../src/**/*.mts",
"../src/**/*.tsx",
"../src/**/*.json"
],
"exclude": [
"../src/package.json"
],
"compilerOptions": {
"outDir": "../.tshy-build/esm"
}
}
Loading

0 comments on commit 0e6b68e

Please sign in to comment.