Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
aggre committed Nov 16, 2023
1 parent f3a7204 commit c26bcbc
Show file tree
Hide file tree
Showing 5 changed files with 3,044 additions and 52 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
# template-repos-cjs-esm

1. Remove `elliptic` and `@types/elliptic` (`yarn remove elliptic @types/elliptic`) because they are just an example package.
2. Edit `index.ts` and install all related packages
3. Push the repository and install it as a git package (e.g., `yarn add https://github.com/dev-protocol/template-repos-cjs-esm.git`)
# @devprotocol/prebuilt-web3auth-modal
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from 'elliptic'
export * from '@web3auth/modal'
22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "template-repos-cjs-esm",
"version": "1.0.0",
"name": "@devprotocol/prebuilt-web3auth-modal",
"version": "0.0.0",
"description": "Template repository for convert Commonjs module to ES module",
"type": "module",
"main": "dist/index.js",
"main": "./dist/index.js",
"browser": "./dist/browser/index.js",
"exports": {
".": {
"default": "./dist/index.js"
"default": "./dist/index.js",
"browser": "./dist/browser/index.js"
}
},
"files": [
Expand All @@ -30,11 +32,13 @@
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-typescript": "^11.1.5",
"@types/elliptic": "^6.4.17",
"elliptic": "^6.5.4",
"@web3auth/modal": "^7.1.1",
"ethers": "^6.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "5.0.5",
"rollup": "^4.0.0",
"rollup-plugin-node-builtins": "^2.1.2",
"tslib": "^2.6.2",
"typescript": "5.2.2"
},
Expand All @@ -44,10 +48,10 @@
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/dev-protocol/template-repos-cjs-esm.git"
"url": "git+ssh://[email protected]/dev-protocol/prebuilt-web3auth-modal.git"
},
"bugs": {
"url": "https://github.com/dev-protocol/template-repos-cjs-esm/issues"
"url": "https://github.com/dev-protocol/prebuilt-web3auth-modal/issues"
},
"homepage": "https://github.com/dev-protocol/template-repos-cjs-esm#readme"
"homepage": "https://github.com/dev-protocol/prebuilt-web3auth-modal#readme"
}
14 changes: 13 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import typescript from '@rollup/plugin-typescript'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import json from '@rollup/plugin-json'
import builtins from 'rollup-plugin-node-builtins'

export default [
{
Expand All @@ -12,8 +13,19 @@ export default [
format: 'es',
},
],
plugins: [typescript(), resolve(), commonjs(), json()],
},
{
input: 'index.ts',
output: [
{
dir: 'dist/browser',
format: 'es',
},
],
plugins: [
typescript(),
typescript({ outDir: 'dist/browser' }),
builtins(),
resolve({ browser: true }),
commonjs({ browser: true }),
json(),
Expand Down
Loading

0 comments on commit c26bcbc

Please sign in to comment.