Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-compiler-baidu): 移除 type 检测的 warning 提示 #173

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions packages/plugin-compiler-baidu/src/templateProcessor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileParserOptions, logger, posthtml } from '@morjs/utils'
import { FileParserOptions, posthtml } from '@morjs/utils'
import path from 'path'
import {
fileType,
Expand Down Expand Up @@ -47,14 +47,6 @@ export const templateProcessor = {
): void {
if (shouldProcess(options) === false) return

// 百度小程序 swan 中不支持组件包含 type 属性
if (attrName === 'type') {
logger.warnOnce(
`${node.tag} 元素包含 \`type\` 属性,会导致百度小程序报错,请替换属性名称\n` +
`文件路径: ${options.fileInfo.path}`
)
}

// swan 不支持绝对路径,这里部分替换为相对路径
// 只能转换静态路径,动态拼接路径不支持转换
if (node.tag === 'image' && attrName === 'src') {
Expand Down