build: include main vue package in aliases and tsconfig paths
This commit is contained in:
parent
277651ce89
commit
8d49b97cc3
@ -19,11 +19,9 @@ const packageOptions = pkg.buildOptions || {}
|
|||||||
// build aliases dynamically
|
// build aliases dynamically
|
||||||
const aliasOptions = { resolve: ['.ts'] }
|
const aliasOptions = { resolve: ['.ts'] }
|
||||||
fs.readdirSync(packagesDir).forEach(dir => {
|
fs.readdirSync(packagesDir).forEach(dir => {
|
||||||
if (
|
if (fs.statSync(path.resolve(packagesDir, dir)).isDirectory()) {
|
||||||
!dir.startsWith('vue') &&
|
const name = dir === `vue` ? dir : `@vue/${dir}`
|
||||||
fs.statSync(path.resolve(packagesDir, dir)).isDirectory()
|
aliasOptions[name] = path.resolve(packagesDir, `${dir}/src/index`)
|
||||||
) {
|
|
||||||
aliasOptions[`@vue/${dir}`] = path.resolve(packagesDir, `${dir}/src/index`)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const aliasPlugin = alias(aliasOptions)
|
const aliasPlugin = alias(aliasOptions)
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"types": ["jest", "node"],
|
"types": ["jest", "node"],
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"vue": ["packages/vue/src"],
|
||||||
"@vue/shared": ["packages/shared/src"],
|
"@vue/shared": ["packages/shared/src"],
|
||||||
"@vue/runtime-core": ["packages/runtime-core/src"],
|
"@vue/runtime-core": ["packages/runtime-core/src"],
|
||||||
"@vue/runtime-dom": ["packages/runtime-dom/src"],
|
"@vue/runtime-dom": ["packages/runtime-dom/src"],
|
||||||
|
Loading…
Reference in New Issue
Block a user