Skip to content

条件编译注释匹配逻辑导致的编译错误 #5368

Open
@minisheeep

Description

@minisheeep

发行方式

小程序

具体平台

微信小程序

开发环境

Windows

项目创建方式

CLI命令行

依赖版本

3.0.0-4030620241128001

问题描述

一些内联 glsl 代码的依赖同样会包含 #endif 注释,代码经过裁剪后会导致编译报错 。
相关问题#4524
uni:pre 插件里的判断太简陋了,麻烦修改下

const hasEndif = isPre && code.includes('#endif')

重现步骤

npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project

在 main.ts
import * as N8ao from 'n8ao';
console.log(N8ao);

编译任意小程序

期望行为

正常编译

实际行为

编译报错 [plugin:uni:mp-main-js] Unbalanced delimiter found in string

截图或录屏

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      条件编译注释匹配逻辑导致的编译错误 · Issue #5368 · dcloudio/uni-app