فهرست منبع

build: suppress rollup external warnings

Evan You 3 سال پیش
والد
کامیت
6fdea68e96
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      rollup.config.mjs

+ 6 - 2
rollup.config.mjs

@@ -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
     ]
   }