Skip to content

Commit

Permalink
Merge pull request #91 from dutu/cjs
Browse files Browse the repository at this point in the history
add CommonJS (CJS) compatibility
  • Loading branch information
dutu authored Apr 25, 2023
2 parents bf8d80a + 1184da4 commit 73e4380
Show file tree
Hide file tree
Showing 202 changed files with 18,432 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
}
3 changes: 3 additions & 0 deletions .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install dependencies
run:
yarn install
- name: Build
run:
yarn build
- name: Run tests
env:
apiKey: ${{ secrets.APIKEY }}
Expand Down
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 73e4380

Please sign in to comment.