Skip to content

Commit

Permalink
chore: rollup config for release of es/js and ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jtassin committed Mar 26, 2019
1 parent 09ce5a7 commit aadaf20
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.rpt2_cache

# Runtime data
pids
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Small tool for wait that all xhr are finished in pupeteer",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "lib/es.js",
"homepage": "https://github.com/jtassin/pending-xhr-puppeteer",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,6 +38,7 @@
"puppeteer": "1.11.0",
"rollup": "1.0.0",
"rollup-plugin-typescript": "^1.0.0",
"rollup-plugin-typescript2": "^0.20.1",
"ts-jest": "^24.0.0",
"tsc": "^1.20150623.0",
"tslib": "^1.9.3",
Expand Down
20 changes: 15 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';

module.exports = {
input: 'src/index.js',
output: {
file: 'lib/index.js',
format: 'cjs',
},
input: 'src/index.ts',
plugins: [typescript({ typescript: require('typescript') })],
output: [
{
file: pkg.main,
format: 'cjs',
},
{
file: pkg.module,
format: 'es',
},
],
};
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ResolvableRequest extends Request {
resolver: () => void;
}

class PendingXHR {
export class PendingXHR {

page: Page;
resourceType: string;
Expand Down Expand Up @@ -64,5 +64,3 @@ class PendingXHR {
return this.pendingXhrs.size;
}
}

module.exports.PendingXHR = PendingXHR;
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "./dist",
"outDir": "build",
"module": "commonjs",
"module": "ES2015",
"target": "es5",
"lib": ["es6"],
"lib": ["ES2015"],
"sourceMap": true,
"allowJs": true,
"moduleResolution": "node",
"rootDir": "src",
"noImplicitReturns": true,
Expand Down
45 changes: 42 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,15 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"

[email protected]:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
Expand Down Expand Up @@ -1527,7 +1536,7 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"

graceful-fs@^4.1.15:
graceful-fs@^4.1.15, graceful-fs@^4.1.6:
version "4.1.15"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00"
integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==
Expand Down Expand Up @@ -2472,6 +2481,13 @@ [email protected], json5@^2.1.0:
dependencies:
minimist "^1.2.0"

jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"

jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
Expand Down Expand Up @@ -3349,7 +3365,7 @@ [email protected]:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

[email protected], resolve@^1.3.2, resolve@^1.8.1:
resolve@1.10.0, resolve@1.x, resolve@^1.3.2, resolve@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==
Expand Down Expand Up @@ -3379,6 +3395,16 @@ rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1:
dependencies:
glob "^7.0.5"

rollup-plugin-typescript2@^0.20.1:
version "0.20.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.20.1.tgz#fb1d411975cd875d24882ea66f5f4fd11d2f2240"
integrity sha512-uxA5JQNOfmJ9rsO0yJKTObb1t4nNYUexCg9zxhEKF+NzZwljYWdfgrA06UzA24cOk8fQjGEe7Q5+Vge2vFlnnw==
dependencies:
fs-extra "7.0.1"
resolve "1.10.0"
rollup-pluginutils "2.4.1"
tslib "1.9.3"

rollup-plugin-typescript@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.0.tgz#f7bcefe576011d9d2ebcc725b542ef35fb5005d4"
Expand All @@ -3387,6 +3413,14 @@ rollup-plugin-typescript@^1.0.0:
resolve "^1.8.1"
rollup-pluginutils "^2.3.1"

[email protected]:
version "2.4.1"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.4.1.tgz#de43ab54965bbf47843599a7f3adceb723de38db"
integrity sha512-wesMQ9/172IJDIW/lYWm0vW0LiKe5Ekjws481R7z9WTRtmO59cqyM/2uUlxvf6yzm/fElFmHUobeQOYz46dZJw==
dependencies:
estree-walker "^0.6.0"
micromatch "^3.1.10"

rollup-pluginutils@^2.3.1:
version "2.5.0"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.5.0.tgz#23be0f05ac3972ea7b08fc7870cb91fde5b23a09"
Expand Down Expand Up @@ -3887,7 +3921,7 @@ tsc@^1.20150623.0:
resolved "https://registry.yarnpkg.com/tsc/-/tsc-1.20150623.0.tgz#4ebc3c774e169148cbc768a7342533f082c7a6e5"
integrity sha1-Trw8d04WkUjLx2inNCUz8ILHpuU=

tslib@^1.9.0, tslib@^1.9.3:
tslib@1.9.3, tslib@^1.9.0, tslib@^1.9.3:
version "1.9.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"

Expand Down Expand Up @@ -3933,6 +3967,11 @@ union-value@^1.0.0:
is-extendable "^0.1.1"
set-value "^0.4.3"

universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==

unset-value@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
Expand Down

0 comments on commit aadaf20

Please sign in to comment.