提交 8b3d8a85 编写于 作者: fxy060608's avatar fxy060608

fix(easycom): maybeSelfReference

上级 aeb959cf
export const PUBLIC_DIR = 'static'
export const EXTNAME_JS = ['.js', '.ts']
export const EXTNAME_VUE = ['.vue', '.nvue', '.fvue']
export const EXTNAME_VUE_RE = /\.(vue|nvue|fvue)$/
export const H5_API_STYLE_PATH = '@dcloudio/uni-h5/style/api/'
export const H5_FRAMEWORK_STYLE_PATH = '@dcloudio/uni-h5/style/framework/'
......
......@@ -9,6 +9,8 @@ export const jsContext = {
MP_WEIXIN: false,
QUICKAPP_NATIVE: false,
QUICKAPP_WEBVIEW: false,
QUICKAPP_WEBVIEW_UNION: false,
QUICKAPP_WEBVIEW_HUAWEI: false,
MP: false,
APP: false,
APP_PLUS_NVUE: false,
......
......@@ -25,7 +25,6 @@
"localstorage-polyfill": "^1.0.1",
"pako": "^2.0.3",
"safe-area-insets": "^1.4.1",
"vue-router": "^4.0.6",
"xmlhttprequest": "^1.8.0"
},
"peerDependencies": {
......
......@@ -7,6 +7,7 @@ export function createOptimizeDeps(
return {
exclude: [
'vue',
'vuex',
'vue-router',
'@dcloudio/uni-app',
'@dcloudio/uni-components',
......
......@@ -67,7 +67,9 @@ export function uniEasycomPlugin(options: UniPluginFilterOptions): Plugin {
debugEasycom(id)
let i = 0
const importDeclarations: string[] = []
code = code.replace(/_resolveComponent\("(.+?)"\)/g, (str, name) => {
code = code.replace(
/_resolveComponent\("(.+?)"(, true)?\)/g,
(str, name) => {
if (name && !name.startsWith('_')) {
if (isBuiltInComponent(name)) {
return addBuiltInImportDeclaration(
......@@ -86,7 +88,8 @@ export function uniEasycomPlugin(options: UniPluginFilterOptions): Plugin {
}
}
return str
})
}
)
if (importDeclarations.length) {
code = importDeclarations.join('') + code
}
......
......@@ -164,7 +164,7 @@ function generatePageDefineCode(pageOptions: UniApp.PagesJsonPageOptions) {
pageOptions.path
)} = defineAsyncComponent(extend({loader:()=>import('./${
pageOptions.path
}.vue?mpType=page')},AsyncComponentOptions))`
}?mpType=page')},AsyncComponentOptions))`
}
function generatePagesDefineCode(
......
......@@ -345,9 +345,9 @@
minimist "^1.2.0"
"@dcloudio/types@^2.2.3":
version "2.2.3"
resolved "https://registry.yarnpkg.com/@dcloudio/types/-/types-2.2.3.tgz#651e61eed278fd2ff44c3a654a6a799cc4a6d1a6"
integrity sha512-pGtihm7tmfaSEwZS8IuT9fnS79MsofycKQBmA9/vP8dufFhMOPxC35S1sovQonB8PhvletY3hK6InxCWe3HIRg==
version "2.2.4"
resolved "https://registry.yarnpkg.com/@dcloudio/types/-/types-2.2.4.tgz#10bf140a90011b5737abafb16a191b4711a89ab1"
integrity sha512-MF/Qs8lZnr4cyhav30TwrPohrlIimxB47y/G+djrt2CK4/MJ0tXI6JKWHZK7jYTaqUG6eG1J0KIkix9jIYS6Uw==
"@eslint/eslintrc@^0.4.1":
version "0.4.1"
......@@ -6331,11 +6331,6 @@ vlq@^0.2.2:
resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26"
integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==
vue-router@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.0.6.tgz#91750db507d26642f225b0ec6064568e5fe448d6"
integrity sha512-Y04llmK2PyaESj+N33VxLjGCUDuv9t4q2OpItEGU7POZiuQZaugV6cJpE6Qm1sVFtxufodLKN2y2dQl9nk0Reg==
vue@^3.1.0-beta.3:
version "3.1.0-beta.3"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.1.0-beta.3.tgz#ed7d944b3d276cbdcda8993f73833a05a182bd13"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册