build: make @vue/shared public

This avoids it being inlined multiple times in esm bundler builds
This commit is contained in:
Evan You
2020-02-29 22:04:42 -05:00
parent e1660f4338
commit bcb2a9b4a6
18 changed files with 88 additions and 68 deletions

View File

@@ -1,4 +1,3 @@
import fs from 'fs'
import path from 'path'
import ts from 'rollup-plugin-typescript2'
import replace from '@rollup/plugin-replace'
@@ -16,10 +15,6 @@ const resolve = p => path.resolve(packageDir, p)
const pkg = require(resolve(`package.json`))
const packageOptions = pkg.buildOptions || {}
const knownExternals = fs.readdirSync(packagesDir).filter(p => {
return p !== '@vue/shared'
})
// ensure TS checks only once for each build
let hasTSChecked = false
@@ -112,9 +107,7 @@ function createConfig(format, output, plugins = []) {
format === 'esm-bundler-runtime' ? `src/runtime.ts` : `src/index.ts`
const external =
isGlobalBuild || isRawESMBuild
? []
: knownExternals.concat(Object.keys(pkg.dependencies || []))
isGlobalBuild || isRawESMBuild ? [] : Object.keys(pkg.dependencies || {})
const nodePlugins = packageOptions.enableNonBrowserBranches
? [