@@ -8,10 +8,8 @@ import * as fs from 'fs';
88import { builtinModules } from 'module' ;
99import * as path from 'path' ;
1010import { fileURLToPath } from 'url' ;
11-
1211import deepMerge from 'deepmerge' ;
13-
14- import { defineConfig } from 'rollup' ;
12+ import { defineConfig } from 'rolldown' ;
1513import {
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.
10299export function makeNPMConfigVariants ( baseConfig , options = { } ) {
103100 const { emitEsm = true , emitCjs = true , splitDevProd = false } = options ;
104101 const baseOutput = baseConfig . output ;
0 commit comments