]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
build: output es2020 (target node 14+) for cjs/server builds
authorEvan You <yyx990803@gmail.com>
Tue, 17 May 2022 02:50:40 +0000 (10:50 +0800)
committerEvan You <yyx990803@gmail.com>
Tue, 17 May 2022 02:50:40 +0000 (10:50 +0800)
rollup.config.js

index 6e909274bc7676d3614566909b1a2df577a64041..16f6a465d9f4d900aa97d88e9e5f42fd1b9094d2 100644 (file)
@@ -84,6 +84,7 @@ function createConfig(format, output, plugins = []) {
     process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file)
   const isBundlerESMBuild = /esm-bundler/.test(format)
   const isBrowserESMBuild = /esm-browser/.test(format)
+  const isServerRenderer = name === 'server-renderer'
   const isNodeBuild = format === 'cjs'
   const isGlobalBuild = /global/.test(format)
   const isCompatPackage = pkg.name === '@vue/compat'
@@ -106,6 +107,7 @@ function createConfig(format, output, plugins = []) {
     cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
     tsconfigOverride: {
       compilerOptions: {
+        target: isServerRenderer || isNodeBuild ? 'es2020' : 'es2015',
         sourceMap: output.sourcemap,
         declaration: shouldEmitDeclarations,
         declarationMap: shouldEmitDeclarations