build: output es2020 (target node 14+) for cjs/server builds
This commit is contained in:
parent
efea4a8b57
commit
cbeb9f2d78
@ -84,6 +84,7 @@ function createConfig(format, output, plugins = []) {
|
|||||||
process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file)
|
process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file)
|
||||||
const isBundlerESMBuild = /esm-bundler/.test(format)
|
const isBundlerESMBuild = /esm-bundler/.test(format)
|
||||||
const isBrowserESMBuild = /esm-browser/.test(format)
|
const isBrowserESMBuild = /esm-browser/.test(format)
|
||||||
|
const isServerRenderer = name === 'server-renderer'
|
||||||
const isNodeBuild = format === 'cjs'
|
const isNodeBuild = format === 'cjs'
|
||||||
const isGlobalBuild = /global/.test(format)
|
const isGlobalBuild = /global/.test(format)
|
||||||
const isCompatPackage = pkg.name === '@vue/compat'
|
const isCompatPackage = pkg.name === '@vue/compat'
|
||||||
@ -106,6 +107,7 @@ function createConfig(format, output, plugins = []) {
|
|||||||
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
|
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
|
||||||
tsconfigOverride: {
|
tsconfigOverride: {
|
||||||
compilerOptions: {
|
compilerOptions: {
|
||||||
|
target: isServerRenderer || isNodeBuild ? 'es2020' : 'es2015',
|
||||||
sourceMap: output.sourcemap,
|
sourceMap: output.sourcemap,
|
||||||
declaration: shouldEmitDeclarations,
|
declaration: shouldEmitDeclarations,
|
||||||
declarationMap: shouldEmitDeclarations
|
declarationMap: shouldEmitDeclarations
|
||||||
|
Loading…
Reference in New Issue
Block a user