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
|
||||
const aliasOptions = { resolve: ['.ts'] }
|
||||
fs.readdirSync(packagesDir).forEach(dir => {
|
||||
if (
|
||||
!dir.startsWith('vue') &&
|
||||
fs.statSync(path.resolve(packagesDir, dir)).isDirectory()
|
||||
) {
|
||||
aliasOptions[`@vue/${dir}`] = path.resolve(packagesDir, `${dir}/src/index`)
|
||||
if (fs.statSync(path.resolve(packagesDir, dir)).isDirectory()) {
|
||||
const name = dir === `vue` ? dir : `@vue/${dir}`
|
||||
aliasOptions[name] = path.resolve(packagesDir, `${dir}/src/index`)
|
||||
}
|
||||
})
|
||||
const aliasPlugin = alias(aliasOptions)
|
||||
|
@ -20,6 +20,7 @@
|
||||
"types": ["jest", "node"],
|
||||
"rootDir": ".",
|
||||
"paths": {
|
||||
"vue": ["packages/vue/src"],
|
||||
"@vue/shared": ["packages/shared/src"],
|
||||
"@vue/runtime-core": ["packages/runtime-core/src"],
|
||||
"@vue/runtime-dom": ["packages/runtime-dom/src"],
|
||||
|
Loading…
Reference in New Issue
Block a user