Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Switch to rollup-plugin-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Nov 19, 2020
1 parent 122c425 commit b819b95
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ package-lock.json
/dist

# Type definitions
/d.ts
*.d.ts
*.d.ts.map
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ node_modules
!/dist

# Include type definitions
!/d.ts
!*.d.ts
!*.d.ts.map
1 change: 0 additions & 1 deletion index.d.ts

This file was deleted.

16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
"url": "https://github.com/proc7ts/render-scheduler/issues"
},
"type": "module",
"main": "dist/render-scheduler.cjs",
"module": "dist/render-scheduler.js",
"types": "index.d.ts",
"main": "./dist/render-scheduler.cjs",
"module": "./dist/render-scheduler.js",
"types": "./index.d.ts",
"exports": {
".": {
"import": "./dist/render-scheduler.js",
"require": "./dist/render-scheduler.cjs"
}
"import": "./dist/render-scheduler.js",
"require": "./dist/render-scheduler.cjs"
},
"devDependencies": {
"@proc7ts/eslint-config": "^2.0.5",
Expand All @@ -34,6 +32,7 @@
"@types/jest": "^26.0.15",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.7.0",
"@wessberg/rollup-plugin-ts": "^1.3.8",
"codecov": "^3.8.1",
"eslint": "^7.13.0",
"eslint-plugin-jest": "^24.1.3",
Expand All @@ -42,7 +41,6 @@
"jest-junit": "^12.0.0",
"rollup": "^2.33.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-typescript2": "^0.29.0",
"run-z": "^1.6.1",
"shx": "^0.3.3",
"ts-jest": "^26.4.4",
Expand All @@ -55,7 +53,7 @@
"all": "run-z build,lint,test",
"build": "run-z +z --then rollup --config ./rollup.config.js",
"ci:all": "run-z all +test/--ci/--runInBand",
"clean": "run-z +z --then shx rm -rf d.ts dist target",
"clean": "run-z +z --then shx rm -rf index.d.ts dist target",
"doc": "run-z +z --then typedoc",
"doc:publish": "run-z doc --then gh-pages --dist target/typedoc --dotfiles",
"lint": "run-z +z --then eslint . --ext .js,.ts",
Expand Down
11 changes: 8 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import ts from '@wessberg/rollup-plugin-ts';
import sourcemaps from 'rollup-plugin-sourcemaps';
import ts from 'rollup-plugin-typescript2';
import typescript from 'typescript';
import pkg from './package.json';

Expand All @@ -11,8 +11,13 @@ export default {
ts({
typescript,
tsconfig: 'tsconfig.main.json',
cacheRoot: 'target/.rts2_cache',
useTsconfigDeclarationDir: true,
hook: {
outputPath(path, kind) {
if (kind === 'declaration') {
return './index.d.ts';
}
},
},
}),
nodeResolve(),
sourcemaps(),
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.main.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationDir": "d.ts",
"declarationMap": true,
"stripInternal": true
},
"exclude": [
Expand Down

0 comments on commit b819b95

Please sign in to comment.