Skip to content

Commit

Permalink
add CommonJS (CJS) compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dutu committed Apr 25, 2023
1 parent bf8d80a commit 6fdda89
Show file tree
Hide file tree
Showing 201 changed files with 18,429 additions and 12,726 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
},
"modules": "commonjs"
}
]
],
"plugins": [
"add-module-exports"
],
"sourceMaps": true
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/

.yarn/*
!.yarn/patches
!.yarn/plugins
Expand Down
7 changes: 7 additions & 0 deletions .mocharc.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extension": ["js"],
"spec": ["test/cjs/*.{test,spec}.cjs", "test/package.test.cjs"],
"require": ["@babel/register"],
"timeout": 60000,
"exit": true
}
6 changes: 6 additions & 0 deletions .mocharc.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extension": ["mjs"],
"spec": "test/**/*.{test,spec}.mjs",
"timeout": 60000,
"exit": true
}
4 changes: 0 additions & 4 deletions .mocharc.json

This file was deleted.

Loading

0 comments on commit 6fdda89

Please sign in to comment.