]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: suppress rollup external warnings
authorEvan You <yyx990803@gmail.com>
Mon, 14 Nov 2022 10:35:09 +0000 (18:35 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 14 Nov 2022 10:35:09 +0000 (18:35 +0800)
rollup.config.mjs

index aeb5d3f5975d85d543fbdcc51ab279713de976ff..36f69fab07fdc786e26489d028160c85155e3a21 100644 (file)
@@ -145,12 +145,13 @@ function createConfig(format, output, plugins = []) {
   }
 
   let external = []
+  const treeShakenDeps = ['source-map', '@babel/parser', 'estree-walker']
 
   if (isGlobalBuild || isBrowserESMBuild || isCompatPackage) {
     if (!packageOptions.enableNonBrowserBranches) {
       // normal browser builds - non-browser only imports are tree-shaken,
       // they are only listed here to suppress warnings.
-      external = ['source-map', '@babel/parser', 'estree-walker']
+      external = treeShakenDeps
     }
   } else {
     // Node / esm-bundler builds.
@@ -158,7 +159,10 @@ function createConfig(format, output, plugins = []) {
     external = [
       ...Object.keys(pkg.dependencies || {}),
       ...Object.keys(pkg.peerDependencies || {}),
-      ...['path', 'url', 'stream'] // for @vue/compiler-sfc / server-renderer
+      // for @vue/compiler-sfc / server-renderer
+      ...['path', 'url', 'stream'],
+      // somehow these throw warnings for runtime-* package builds
+      ...treeShakenDeps
     ]
   }