From ed0e8190dd32f6592633f8c3b0d313287b65804e Mon Sep 17 00:00:00 2001 From: osdevisnot Date: Thu, 13 May 2021 22:02:42 -0700 Subject: [PATCH] fix: replace unmaintained nodeGlobals plugin with well maintained alternative rollup-plugin-node-globals uses an older version of acorn which breaks compat for modern es2020 code. rollup-plugin-polyfill-node is a well maintained alternative of rollup-plugin-node-globals. BREAKING CHANGE: there is a chance of change in compile output if you previously relied on klap replacing node globals in your code fix #231 --- package.json | 2 +- src/plugins.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e625722..82b308c 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "pretty-bytes": "5.6.0", "rollup": "2.47.0", "rollup-plugin-dts": "3.0.1", - "rollup-plugin-node-globals": "1.4.0", + "rollup-plugin-polyfill-node": "0.6.2", "semantic-release": "17.4.3", "servor": "4.0.2", "sort-package-json": "1.50.0", diff --git a/src/plugins.js b/src/plugins.js index 8b6b122..8f0865d 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -3,7 +3,7 @@ import nodeResolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import replace from '@rollup/plugin-replace' -import nodeGlobals from 'rollup-plugin-node-globals' +import nodePolyfills from 'rollup-plugin-polyfill-node'; import babel from '@rollup/plugin-babel' import { terser } from './packages/terser.js' @@ -21,7 +21,7 @@ const plugins = (command, pkg, options) => { return [ json(), - nodeGlobals(), + nodePolyfills({sourceMap: sourcemap}), nodeResolve({ mainFields: ['module', 'jsnext:main', 'browser', 'main'], extensions,