Skip to content

Commit 73e4380

Browse files
authored
Merge pull request #91 from dutu/cjs
add CommonJS (CJS) compatibility
2 parents bf8d80a + 1184da4 commit 73e4380

File tree

202 files changed

+18432
-12726
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+18432
-12726
lines changed

.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"node": "current"
8+
},
9+
"modules": "commonjs"
10+
}
11+
]
12+
],
13+
"plugins": [
14+
"add-module-exports"
15+
],
16+
"sourceMaps": true
17+
}

.github/workflows/nodejs-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Install dependencies
2323
run:
2424
yarn install
25+
- name: Build
26+
run:
27+
yarn build
2528
- name: Run tests
2629
env:
2730
apiKey: ${{ secrets.APIKEY }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
dist/
2+
13
.yarn/*
24
!.yarn/patches
35
!.yarn/plugins

.mocharc.cjs.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extension": ["js"],
3+
"spec": ["test/cjs/*.{test,spec}.cjs", "test/package.test.cjs"],
4+
"require": ["@babel/register"],
5+
"timeout": 60000,
6+
"exit": true
7+
}

.mocharc.esm.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extension": ["mjs"],
3+
"spec": "test/**/*.{test,spec}.mjs",
4+
"timeout": 60000,
5+
"exit": true
6+
}

.mocharc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)