Skip to content

Commit

Permalink
switch ts bundling plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
madhav-stripe committed Mar 4, 2024
1 parent 432cfe2 commit 947e418
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x
- run: yarn install --frozen-lockfile
- run: yarn run lint:prettier
- run: yarn run lint
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"dist",
"src"
],
"engines": {
"node": ">=12.16"
},
"jest": {
"preset": "ts-jest/presets/js-with-ts",
"setupFilesAfterEnv": [
Expand Down Expand Up @@ -71,7 +74,6 @@
"@types/react-dom": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@wessberg/rollup-plugin-ts": "^1.2.15",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
Expand All @@ -95,9 +97,11 @@
"rollup": "^1.27.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup-plugin-typescript2": "^0.36.0",
"ts-jest": "^25.1.0",
"ts-loader": "^6.2.1",
"typescript": "^4.1.2"
Expand Down
10 changes: 9 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
import {terser} from 'rollup-plugin-terser';
import replace from 'rollup-plugin-replace';
import ts from '@wessberg/rollup-plugin-ts';
import ts from 'rollup-plugin-typescript2';
import {dts} from 'rollup-plugin-dts';
import pkg from './package.json';

const PLUGINS = [
Expand All @@ -29,6 +30,13 @@ export default [
],
plugins: PLUGINS,
},
{
input: 'src/index.ts',
external: ['react', 'prop-types'],
output: [{file: './dist/react-stripe.d.ts', format: 'cjs'}],
plugins: [dts()],
},

// UMD build with inline PropTypes
{
input: 'src/index.ts',
Expand Down
Loading

0 comments on commit 947e418

Please sign in to comment.