]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: fix compiler dep externalization
authorEvan You <yyx990803@gmail.com>
Wed, 5 May 2021 15:05:53 +0000 (11:05 -0400)
committerEvan You <yyx990803@gmail.com>
Wed, 5 May 2021 15:05:53 +0000 (11:05 -0400)
rollup.config.js

index 5c5d3b90ef504d25e28e4def50d13095e9f8982e..d785735e8bf1cecb6b56a792e64d5ff355de5042 100644 (file)
@@ -91,6 +91,7 @@ function createConfig(format, output, plugins = []) {
   const isNodeBuild = format === 'cjs'
   const isGlobalBuild = /global/.test(format)
   const isCompatBuild = !!packageOptions.compat
+  const isCompatPackage = pkg.name === '@vue/compat'
 
   if (isGlobalBuild) {
     output.name = packageOptions.name
@@ -121,7 +122,7 @@ function createConfig(format, output, plugins = []) {
   // the compat build needs both default AND named exports. This will cause
   // Rollup to complain for non-ESM targets, so we use separate entries for
   // esm vs. non-esm builds.
-  if (isCompatBuild && (isBrowserESMBuild || isBundlerESMBuild)) {
+  if (isCompatPackage && (isBrowserESMBuild || isBundlerESMBuild)) {
     entryFile = /runtime$/.test(format)
       ? `src/esm-runtime.ts`
       : `src/esm-index.ts`
@@ -129,7 +130,7 @@ function createConfig(format, output, plugins = []) {
 
   let external = []
 
-  if (isGlobalBuild || isBrowserESMBuild || isCompatBuild) {
+  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.