Skip to content

Commit 5e29ba9

Browse files
author
Evgeny Zakharov
committed
feat: add typescript rollup plugin
1 parent 3c39784 commit 5e29ba9

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
},
2626
"dependencies": {},
2727
"devDependencies": {
28+
"@rollup/plugin-typescript": "^8.3.2",
2829
"@types/jest": "^27.5.1",
2930
"esbuild": "^0.14.39",
3031
"eslint": "^8.16.0",

rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/* eslint-disable import/no-default-export */
22
/* eslint-disable no-unused-vars */
33

4+
import typescript from '@rollup/plugin-typescript'
45
import { defineConfig } from 'rollup'
56
import bundleSize from 'rollup-plugin-bundle-size'
67
import dts from 'rollup-plugin-dts'
78
import esbuild from 'rollup-plugin-esbuild'
89
import { terser } from 'rollup-plugin-terser'
910
import pkg from './package.json'
1011

12+
const TYPECHECK = true
1113
const MINIFY = true
1214

1315
const src = (file) => `src/${file}`
@@ -26,7 +28,7 @@ const bundle = (input, { plugins = [], ...config }) =>
2628
const config = defineConfig([
2729
/* Compiled JS (CommonJS, ESM) */
2830
bundle(src('index.ts'), {
29-
plugins: [esbuild(), MINIFY && terser()],
31+
plugins: [TYPECHECK && typescript(), esbuild(), MINIFY && terser()],
3032
output: [
3133
{
3234
file: pkg.main,

yarn.lock

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,23 @@
687687
"@nodelib/fs.scandir" "2.1.5"
688688
fastq "^1.6.0"
689689

690+
"@rollup/plugin-typescript@^8.3.2":
691+
version "8.3.2"
692+
resolved "https://registry.yarnpkg.com/@rollup/plugin-typescript/-/plugin-typescript-8.3.2.tgz#e1b719e2ed3e752bbc092001656c48378f2d15f0"
693+
integrity sha512-MtgyR5LNHZr3GyN0tM7gNO9D0CS+Y+vflS4v/PHmrX17JCkHUYKvQ5jN5o3cz1YKllM3duXUqu3yOHwMPUxhDg==
694+
dependencies:
695+
"@rollup/pluginutils" "^3.1.0"
696+
resolve "^1.17.0"
697+
698+
"@rollup/pluginutils@^3.1.0":
699+
version "3.1.0"
700+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
701+
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
702+
dependencies:
703+
"@types/estree" "0.0.39"
704+
estree-walker "^1.0.1"
705+
picomatch "^2.2.2"
706+
690707
"@rollup/pluginutils@^4.1.1":
691708
version "4.2.1"
692709
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
@@ -747,6 +764,11 @@
747764
dependencies:
748765
"@babel/types" "^7.3.0"
749766

767+
768+
version "0.0.39"
769+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
770+
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
771+
750772
"@types/graceful-fs@^4.1.3":
751773
version "4.1.5"
752774
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15"
@@ -1973,6 +1995,11 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0:
19731995
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
19741996
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
19751997

1998+
estree-walker@^1.0.1:
1999+
version "1.0.1"
2000+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
2001+
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
2002+
19762003
estree-walker@^2.0.1:
19772004
version "2.0.2"
19782005
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
@@ -3653,7 +3680,7 @@ resolve.exports@^1.1.0:
36533680
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9"
36543681
integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==
36553682

3656-
resolve@^1.10.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.3.0:
3683+
resolve@^1.10.0, resolve@^1.17.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.3.0:
36573684
version "1.22.0"
36583685
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198"
36593686
integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==

0 commit comments

Comments
 (0)