Skip to content

Commit

Permalink
fix: replace unmaintained nodeGlobals plugin with well maintained alt…
Browse files Browse the repository at this point in the history
…ernative

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
  • Loading branch information
osdevisnot committed May 14, 2021
1 parent c8d2ce3 commit ed0e819
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -21,7 +21,7 @@ const plugins = (command, pkg, options) => {

return [
json(),
nodeGlobals(),
nodePolyfills({sourceMap: sourcemap}),
nodeResolve({
mainFields: ['module', 'jsnext:main', 'browser', 'main'],
extensions,
Expand Down

0 comments on commit ed0e819

Please sign in to comment.