-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
问题描述
@tarojs/test-utils-shared
包的 package.json
{
"name": "@tarojs/test-utils-shared",
"version": "0.1.1",
"main": "dist/index.js",
"type": "module",
"license": "MIT",
"scripts": {
"dev": "tsc -w",
"build": "tsc"
},
"types": "dist",
"typings": "dist/index.d.ts",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@babel/runtime": "^7.21.5",
"babel-jest": "^29.5.0",
"pretty-format": "^29.5.0"
},
"devDependencies": {
"@tarojs/runtime": "^3.6.0",
"@tarojs/router": "^3.6.0",
"@tarojs/taro": "^3.6.0",
"@tarojs/taro-h5": "^3.6.0",
"@babel/core": "^7.8.0"
}
}
test-utils-shared/src/lifecycle.ts
用到了 devDependencies
的依赖
import type { AppInstance, PageInstance } from '@tarojs/runtime'
import type { PageResizeObject, PageScrollObject, ShareAppMessageObject, TabItemTapObject } from '@tarojs/taro'
import stacks from '@tarojs/router/dist/router/stack'
...
期望结果
依赖引用和声明统一,避免执行报错
Cannot find module '@tarojs/router/dist/router/stack' from 'node_modules/@tarojs/test-utils-shared/dist/lifecycle.js'
Metadata
Metadata
Assignees
Labels
No labels