Skip to content

Commit

Permalink
Merge pull request #173 from hwaphon/feat/invalid-warn-remove
Browse files Browse the repository at this point in the history
feat(plugin-compiler-baidu): 移除 type 检测的 warning 提示
  • Loading branch information
hwaphon authored Mar 25, 2024
2 parents 8e5fb99 + 148c9fe commit d37e15e
Showing 1 changed file with 1 addition and 9 deletions.
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

0 comments on commit d37e15e

Please sign in to comment.