-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: set up rollup for multiplatform builds (#96)
- Loading branch information
1 parent
334a5db
commit a66fb5d
Showing
5 changed files
with
1,870 additions
and
1,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,19 @@ | |
"crawler" | ||
], | ||
"version": "0.13.1", | ||
"main": "dist/_module.js", | ||
"main": "dist/default/cjs/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"exports": { | ||
"types": "./dist/types/index.d.ts", | ||
"node": { | ||
"import": "./dist/node/esm/index.mjs", | ||
"require": "./dist/node/cjs/index.cjs" | ||
}, | ||
"default": { | ||
"import": "./dist/default/esm/index.mjs", | ||
"require": "./dist/default/cjs/index.js" | ||
} | ||
}, | ||
"repository": "https://github.com/the-convocation/twitter-scraper.git", | ||
"author": "karashiiro <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -17,7 +29,7 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "rimraf dist && rollup -c", | ||
"commit": "cz", | ||
"docs:generate": "typedoc --options typedoc.json", | ||
"docs:deploy": "yarn docs:generate && gh-pages -d docs", | ||
|
@@ -47,6 +59,7 @@ | |
"@typescript-eslint/parser": "^5.59.7", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"dotenv": "^16.3.1", | ||
"esbuild": "^0.21.5", | ||
"eslint": "^8.41.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
|
@@ -56,6 +69,10 @@ | |
"jest": "^29.5.0", | ||
"lint-staged": "^13.2.2", | ||
"prettier": "^2.8.8", | ||
"rimraf": "^5.0.7", | ||
"rollup": "^4.18.0", | ||
"rollup-plugin-dts": "^6.1.1", | ||
"rollup-plugin-esbuild": "^6.1.1", | ||
"ts-jest": "^29.1.0", | ||
"typedoc": "^0.24.7", | ||
"typescript": "^5.0.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import dts from 'rollup-plugin-dts'; | ||
import esbuild from 'rollup-plugin-esbuild'; | ||
|
||
export default [ | ||
{ | ||
input: 'src/_module.ts', | ||
plugins: [ | ||
esbuild({ | ||
define: { | ||
PLATFORM_NODE: 'false', | ||
PLATFORM_NODE_JEST: 'false', | ||
}, | ||
}), | ||
], | ||
output: [ | ||
{ | ||
file: 'dist/default/cjs/index.js', | ||
format: 'cjs', | ||
sourcemap: true, | ||
}, | ||
{ | ||
file: 'dist/default/esm/index.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
}, | ||
], | ||
}, | ||
{ | ||
input: 'src/_module.ts', | ||
plugins: [ | ||
esbuild({ | ||
define: { | ||
PLATFORM_NODE: 'true', | ||
PLATFORM_NODE_JEST: 'false', | ||
}, | ||
}), | ||
], | ||
output: [ | ||
{ | ||
file: 'dist/node/cjs/index.cjs', | ||
format: 'cjs', | ||
sourcemap: true, | ||
inlineDynamicImports: true, | ||
}, | ||
{ | ||
file: 'dist/node/esm/index.mjs', | ||
format: 'es', | ||
sourcemap: true, | ||
inlineDynamicImports: true, | ||
}, | ||
], | ||
}, | ||
{ | ||
input: 'src/_module.ts', | ||
plugins: [dts()], | ||
output: { | ||
file: 'dist/types/index.d.ts', | ||
format: 'es', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.