Skip to content

Commit

Permalink
Declare built-in modules xml and zlib as externals
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed May 19, 2023
1 parent cf05d5c commit d3d3d71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'


// List of njs built-in modules.
const njsExternals = ['crypto', 'fs', 'querystring']
//
// - xml has added in njs 0.7.11
// - zlib was added in njs 0.7.12
const njsExternals = ['crypto', 'fs', 'querystring', 'xml', 'zlib']
const isEnvProd = process.env.NODE_ENV === 'production'

/**
* Plugin to fix syntax of the default export to be compatible with njs.
* (https://github.com/rollup/rollup/pull/4182#issuecomment-1002241017)
*
* If you use njs >=0.7.12, you can remove this.
*
* @return {import('rollup').OutputPlugin}
*/
const fixExportDefault = () => ({
Expand Down

0 comments on commit d3d3d71

Please sign in to comment.