build: use buildOption to determine runtime compile build (#742)

This makes it possible to create a separate package that uses runtime compilation.
This commit is contained in:
basvanmeurs 2020-02-19 15:50:24 +01:00 committed by GitHub
parent 7b987d9450
commit 8d817bb446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@
],
"buildOptions": {
"name": "Vue",
"isRuntimeCompileBuild": true,
"formats": [
"esm-bundler",
"esm-bundler-runtime",

View File

@ -82,7 +82,7 @@ function createConfig(format, output, plugins = []) {
const isRawESMBuild = format === 'esm'
const isNodeBuild = format === 'cjs'
const isBundlerESMBuild = /esm-bundler/.test(format)
const isRuntimeCompileBuild = /vue\./.test(output.file)
const isRuntimeCompileBuild = packageOptions.isRuntimeCompileBuild
if (isGlobalBuild) {
output.name = packageOptions.name