Skip to content

Commit

Permalink
build: output es2020 (target node 14+) for cjs/server builds
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 17, 2022
1 parent efea4a8 commit cbeb9f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down

0 comments on commit cbeb9f2

Please sign in to comment.