Skip to content

Commit

Permalink
fix(test): fix runtime moduleNameMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Jul 7, 2022
1 parent c4221cb commit f156d6c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
13 changes: 0 additions & 13 deletions packages/taro-plugin-vue3/src/runtime/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { chalk } from '@tarojs/helper'
import { Current } from '@tarojs/runtime'

/**
Expand All @@ -20,15 +19,3 @@ export function setRouterParams (options) {
...options
}
}

export function getVueLoaderPath (): string {
try {
return require.resolve('vue-loader', {
paths: [process.cwd()]
})
} catch (error) {
// eslint-disable-next-line no-console
console.log(chalk.yellow('找不到 vue-loader,请先安装。'))
process.exit(1)
}
}
13 changes: 13 additions & 0 deletions packages/taro-plugin-vue3/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { chalk } from '@tarojs/helper'

export function getVueLoaderPath (): string {
try {
return require.resolve('vue-loader', {
paths: [process.cwd()]
})
} catch (error) {
// eslint-disable-next-line no-console
console.log(chalk.yellow('找不到 vue-loader,请先安装。'))
process.exit(1)
}
}
2 changes: 1 addition & 1 deletion packages/taro-plugin-vue3/src/webpack.h5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ElementNode, RootNode, TemplateChildNode } from '@vue/compiler-cor

import type { IConfig } from './index'
import { getLoaderMeta } from './loader-meta'
import { getVueLoaderPath } from './runtime/utils'
import { getVueLoaderPath } from './utils'

export function modifyH5WebpackChain (ctx: IPluginContext, chain, config: IConfig) {
// vue3 tsx 使用原生组件
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-plugin-vue3/src/webpack.mini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { AttributeNode, DirectiveNode, ElementNode, RootNode, SimpleExpress

import type { IConfig } from './index'
import { getLoaderMeta } from './loader-meta'
import { getVueLoaderPath } from './runtime/utils'
import { getVueLoaderPath } from './utils'

const CUSTOM_WRAPPER = 'custom-wrapper'

Expand Down

0 comments on commit f156d6c

Please sign in to comment.