build: fix compat build type treatment

This commit is contained in:
Evan You 2021-05-08 16:21:06 -04:00
parent 341fa38f9b
commit f2fb8a51a9
3 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{ {
"extends": "../../api-extractor.json", "extends": "../../api-extractor.json",
"mainEntryPointFilePath": "./dist/packages/<unscopedPackageName>/src/index.d.ts", "mainEntryPointFilePath": "./dist/packages/vue-compat/src/index.d.ts",
"dtsRollup": { "dtsRollup": {
"publicTrimmedFilePath": "./dist/<unscopedPackageName>.d.ts" "publicTrimmedFilePath": "./dist/vue.d.ts"
} }
} }

View File

@ -4,7 +4,6 @@
"description": "Vue 3 compatibility build for Vue 2", "description": "Vue 3 compatibility build for Vue 2",
"main": "index.js", "main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js", "module": "dist/vue.runtime.esm-bundler.js",
"types": "dist/vue.d.ts",
"unpkg": "dist/vue.global.js", "unpkg": "dist/vue.global.js",
"jsdelivr": "dist/vue.global.js", "jsdelivr": "dist/vue.global.js",
"files": [ "files": [

View File

@ -81,6 +81,7 @@ function createConfig(format, output, plugins = []) {
process.exit(1) process.exit(1)
} }
output.exports = 'auto'
output.sourcemap = !!process.env.SOURCE_MAP output.sourcemap = !!process.env.SOURCE_MAP
output.externalLiveBindings = false output.externalLiveBindings = false
@ -97,7 +98,8 @@ function createConfig(format, output, plugins = []) {
output.name = packageOptions.name output.name = packageOptions.name
} }
const shouldEmitDeclarations = process.env.TYPES != null && !hasTSChecked const shouldEmitDeclarations =
pkg.types && process.env.TYPES != null && !hasTSChecked
const tsPlugin = ts({ const tsPlugin = ts({
check: process.env.NODE_ENV === 'production' && !hasTSChecked, check: process.env.NODE_ENV === 'production' && !hasTSChecked,