build: make @vue/shared public
This avoids it being inlined multiple times in esm bundler builds
This commit is contained in:
@@ -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
|
||||
? [
|
||||
|
||||
Reference in New Issue
Block a user