Skip to content

Commit

Permalink
upgrade rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
madhav-stripe committed Mar 5, 2024
1 parent caf1825 commit f557f2e
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 226 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "2.5.1",
"description": "React components for Stripe.js and Stripe Elements",
"main": "dist/react-stripe.js",
"module": "dist/react-stripe.esm.js",
"jsnext:main": "dist/react-stripe.esm.js",
"module": "dist/react-stripe.esm.mjs",
"jsnext:main": "dist/react-stripe.esm.mjs",
"browser:min": "dist/react-stripe.umd.min.js",
"browser": "dist/react-stripe.umd.js",
"types": "dist/react-stripe.d.ts",
Expand All @@ -14,7 +14,7 @@
"lint": "eslint --max-warnings=0 '{src,examples}/**/*.{ts,tsx,js}'",
"lint:prettier": "prettier './**/*.js' './**/*.ts' './**/*.tsx' './**/*.css' './**/*.md' --list-different",
"typecheck": "tsc",
"build": "yarn run clean && yarn run rollup -c && yarn checkimport",
"build": "yarn run clean && yarn run rollup -c --bundleConfigAsCjs && yarn checkimport",
"checkimport": "scripts/check-imports",
"clean": "rimraf dist",
"prettier:fix": "prettier './**/*.js' './**/*.ts' './**/*.tsx' './**/*.css' './**/*.md' --write",
Expand Down Expand Up @@ -54,13 +54,18 @@
}
},
"dependencies": {
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"prop-types": "^15.7.2"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/preset-react": "^7.7.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@storybook/react": "^6.5.0-beta.8",
"@stripe/stripe-js": "^2.2.0",
"@testing-library/jest-dom": "^5.16.4",
Expand All @@ -71,7 +76,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 @@ -92,15 +96,11 @@
"react-dom": "18.1.0",
"react-test-renderer": "^18.0.0",
"rimraf": "^2.6.2",
"rollup": "^1.27.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^5.1.2",
"rollup": "^4.12.0",
"rollup-plugin-ts": "^3.4.5",
"ts-jest": "^25.1.0",
"ts-loader": "^6.2.1",
"typescript": "^3.7.5"
"typescript": "^4.1.2"
},
"resolutions": {
"@types/react": "18.0.5"
Expand Down
17 changes: 9 additions & 8 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import babel from 'rollup-plugin-babel';
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 {babel} from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import terser from '@rollup/plugin-terser';
import ts from 'rollup-plugin-ts';
import pkg from './package.json';

const PLUGINS = [
commonjs(),
ts(),
resolve(),
nodeResolve(),
babel({
extensions: ['.ts', '.js', '.tsx', '.jsx'],
}),
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
_VERSION: JSON.stringify(pkg.version),
preventAssignment: true,
}),
commonjs(),
];

export default [
Expand Down
2 changes: 1 addition & 1 deletion scripts/check-imports
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ checkImport() {
}

checkImport "/dist/react-stripe.d.ts" 'import [^*{]' 'Please only use * or named imports for types' && \
checkImport "/dist/react-stripe.esm.js" 'import.*{' 'Please do not use named imports for dependencies'
checkImport "/dist/react-stripe.esm.mjs" 'import.*{' 'Please do not use named imports for dependencies'
Loading

0 comments on commit f557f2e

Please sign in to comment.