test: fix import

This commit is contained in:
Evan You 2019-10-05 23:20:02 -04:00
parent 82bd9eb1db
commit c4f9b6d592
3 changed files with 5 additions and 4 deletions

View File

@ -24,7 +24,7 @@ import {
RESOLVE_COMPONENT
} from '../src/runtimeHelpers'
import { createElementWithCodegen } from './testUtils'
import { PatchFlags } from 'vue'
import { PatchFlags } from '@vue/shared'
function createRoot(options: Partial<RootNode> = {}): RootNode {
return {

View File

@ -19,9 +19,11 @@ const packageOptions = pkg.buildOptions || {}
// build aliases dynamically
const aliasOptions = { resolve: ['.ts'] }
fs.readdirSync(packagesDir).forEach(dir => {
if (dir === 'vue') {
return
}
if (fs.statSync(path.resolve(packagesDir, dir)).isDirectory()) {
const name = dir === `vue` ? dir : `@vue/${dir}`
aliasOptions[name] = path.resolve(packagesDir, `${dir}/src/index`)
aliasOptions[`@vue/${dir}`] = path.resolve(packagesDir, `${dir}/src/index`)
}
})
const aliasPlugin = alias(aliasOptions)

View File

@ -20,7 +20,6 @@
"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"],