@@ -447,10 +447,12 @@ const shebang = {};
447447function createConfig ( options , entry , format , writeMeta ) {
448448 let { pkg } = options ;
449449
450+ /** @type {(string|RegExp)[] } */
450451 let external = [ 'dns' , 'fs' , 'path' , 'url' ] . concat (
451452 options . entries . filter ( e => e !== entry ) ,
452453 ) ;
453454
455+ /** @type {Record<string, string> } */
454456 let outputAliases = { } ;
455457 // since we transform src/index.js, we need to rename imports for it:
456458 if ( options . multipleEntries ) {
@@ -540,10 +542,15 @@ function createConfig(options, entry, format, writeMeta) {
540542
541543 if ( nameCache === bareNameCache ) nameCache = null ;
542544
545+ /** @type {false | import('rollup').RollupCache } */
546+ let cache ;
547+ if ( modern ) cache = false ;
548+
543549 let config = {
550+ /** @type {import('rollup').InputOptions } */
544551 inputOptions : {
545552 // disable Rollup's cache for the modern build to prevent re-use of legacy transpiled modules:
546- cache : modern ? false : undefined ,
553+ cache,
547554
548555 input : entry ,
549556 external : id => {
@@ -576,7 +583,8 @@ function createConfig(options, entry, format, writeMeta) {
576583 } ) ,
577584 moduleAliases . length > 0 &&
578585 alias ( {
579- resolve : EXTENSIONS ,
586+ // @TODO : this is no longer supported, but didn't appear to be required?
587+ // resolve: EXTENSIONS,
580588 entries : moduleAliases ,
581589 } ) ,
582590 nodeResolve ( {
@@ -712,11 +720,11 @@ function createConfig(options, entry, format, writeMeta) {
712720 . filter ( Boolean ) ,
713721 } ,
714722
723+ /** @type {import('rollup').OutputOptions } */
715724 outputOptions : {
716725 paths : outputAliases ,
717726 globals,
718727 strict : options . strict === true ,
719- legacy : true ,
720728 freeze : false ,
721729 esModule : false ,
722730 sourcemap : options . sourcemap ,
0 commit comments