diff --git a/rollup.config.js b/rollup.config.js index 65a3678e777..e07f6bb6371 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -81,7 +81,8 @@ function createConfig(format, output, plugins = []) { process.exit(1) } - output.exports = 'named' + const isCompatBuild = !!packageOptions.compat + output.exports = isCompatBuild ? 'default' : 'named' output.sourcemap = !!process.env.SOURCE_MAP output.externalLiveBindings = false @@ -91,7 +92,6 @@ function createConfig(format, output, plugins = []) { const isBrowserESMBuild = /esm-browser/.test(format) const isNodeBuild = format === 'cjs' const isGlobalBuild = /global/.test(format) - const isCompatBuild = !!packageOptions.compat const isCompatPackage = pkg.name === '@vue/compat' if (isGlobalBuild) {