Skip to content

Commit a4ee42c

Browse files
committed
add externals option
1 parent 85536c5 commit a4ee42c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rollup/npmHelpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { makeNodeResolvePlugin, makeSucrasePlugin } from './plugins/index.js';
1212
const packageDotJSON = require(path.resolve(process.cwd(), './package.json'));
1313

1414
export function makeBaseNPMConfig(options = {}) {
15-
const { entrypoints = ['src/index.ts'], hasBundles = false } = options;
15+
const { entrypoints = ['src/index.ts'], externals: packageSpecificExternals = [], hasBundles = false } = options;
1616

1717
const nodeResolvePlugin = makeNodeResolvePlugin();
1818
const sucrasePlugin = makeSucrasePlugin();
@@ -53,6 +53,7 @@ export function makeBaseNPMConfig(options = {}) {
5353
...Object.keys(packageDotJSON.dependencies || {}),
5454
...Object.keys(packageDotJSON.devDependencies || {}),
5555
...Object.keys(packageDotJSON.peerDependencies || {}),
56+
...packageSpecificExternals,
5657
],
5758

5859
// TODO `'smallest'` will get rid of `isDebugBuild()` by evaluating it and inlining the result and then treeshaking

0 commit comments

Comments
 (0)