Skip to content

Commit

Permalink
Add a fallback cjs build using babel
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Nov 12, 2024
1 parent f9f68fd commit ca61457
Show file tree
Hide file tree
Showing 5 changed files with 433 additions and 211 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"parserOptions": {
"ecmaVersion": 13
},
"ignorePatterns": ["cjs"],
"rules": {
"import/extensions": ["error", "always"],
"semi": ["error", "never"],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/*
build/*
dist/*
cjs/*
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
["@babel/plugin-transform-modules-commonjs"],
["babel-plugin-transform-rewrite-imports", {
"replaceExtensions": {
"sha.js/sha256.js": "sha.js/sha256.js",
"blakejs/blake2b.js": "blakejs/blake2b.js",
".js": ".cjs"
}
}]
]
}
Loading

0 comments on commit ca61457

Please sign in to comment.