diff --git a/packages/checkout/widgets-lib/package.json b/packages/checkout/widgets-lib/package.json index 142fadd3a3..198ff19291 100644 --- a/packages/checkout/widgets-lib/package.json +++ b/packages/checkout/widgets-lib/package.json @@ -76,15 +76,10 @@ "private": true, "scripts": { "build": "rollup --config rollup.config.js", - "build:dist": "yarn build && yarn dist:sample", - "dist:sample": "mkdir -p ../widgets-sample-app/public/lib/js && cp build/static/js/main.*.js ../widgets-sample-app/public/lib/js/imtbl-checkout.js", - "dist:sdk": "mkdir -p ../../../sdk/dist/browser && cp build/static/js/main.*.js ../../../sdk/dist/browser/checkout.js", - "eject": "react-app-rewired eject", + "build:local": "yarn build && mkdir -p ../widgets-sample-app/public/lib/js && cp dist/widgets.js ../widgets-sample-app/public/lib/js/widgets.js", "lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0", "lint:fix": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0 --fix", "start": "rollup --config rollup.config.js --watch", - "start:dev": "CHECKOUT_DEV_MODE=true yarn start", - "start:local": "yarn build && mkdir -p ../widgets-sample-app/public/lib/js && cp dist/widgets.js ../widgets-sample-app/public/lib/js/widgets.js", "test": "jest test --passWithNoTests", "test:cypress": "NODE_ENV=test cypress run --component --headless", "test:cypress:open": "NODE_ENV=test cypress open --component --browser electron", diff --git a/packages/checkout/widgets-lib/rollup.config.js b/packages/checkout/widgets-lib/rollup.config.js index 08efcfdb14..7d52b65fed 100644 --- a/packages/checkout/widgets-lib/rollup.config.js +++ b/packages/checkout/widgets-lib/rollup.config.js @@ -4,14 +4,12 @@ import resolve from '@rollup/plugin-node-resolve'; import json from '@rollup/plugin-json'; import terser from '@rollup/plugin-terser'; import replace from '@rollup/plugin-replace'; +import nodePolyfills from 'rollup-plugin-polyfill-node'; const defaultPlugin = [ replace({ preventAssignment: true, 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'), - 'process.env.CHECKOUT_DEV_MODE': JSON.stringify(process.env.CHECKOUT_DEV_MODE || 'false'), - 'process.env.CHECKOUT_LOCAL_MODE': JSON.stringify(process.env.CHECKOUT_LOCAL_MODE || 'false'), - 'process.versions': JSON.stringify(process.versions || {}) }), typescript() ] @@ -43,6 +41,7 @@ export default [ }), json(), commonjs(), + nodePolyfills(), ...defaultPlugin, terser(), ]