Skip to content

Commit be95795

Browse files
committed
chore: use defineConfig for type assist
1 parent 4a4f434 commit be95795

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

dev-packages/rollup-utils/npmHelpers.mjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ import * as fs from 'fs';
88
import { builtinModules } from 'module';
99
import * as path from 'path';
1010
import { fileURLToPath } from 'url';
11-
1211
import deepMerge from 'deepmerge';
13-
14-
import { defineConfig } from 'rollup';
12+
import { defineConfig } from 'rolldown';
1513
import {
1614
makeDebugBuildStatementReplacePlugin,
1715
makeProductionReplacePlugin,
@@ -40,7 +38,7 @@ export function makeBaseNPMConfig(options = {}) {
4038
excludeIframe: undefined,
4139
});
4240

43-
const defaultBaseConfig = {
41+
const defaultBaseConfig = defineConfig({
4442
input: entrypoints,
4543

4644
output: {
@@ -90,15 +88,14 @@ export function makeBaseNPMConfig(options = {}) {
9088
...Object.keys(packageDotJSON.peerDependencies || {}),
9189
...Object.keys(packageDotJSON.optionalDependencies || {}),
9290
],
93-
};
91+
});
9492

9593
return deepMerge(defaultBaseConfig, packageSpecificConfig, {
9694
// Plugins have to be in the correct order or everything breaks, so when merging we have to manually re-order them
9795
customMerge: key => (key === 'plugins' ? mergePlugins : undefined),
9896
});
9997
}
10098

101-
// TODO: Instead of runtime checks, we should use TypeScript to ensure the base config is valid.
10299
export function makeNPMConfigVariants(baseConfig, options = {}) {
103100
const { emitEsm = true, emitCjs = true, splitDevProd = false } = options;
104101
const baseOutput = baseConfig.output;

0 commit comments

Comments
 (0)