fix(compiler-dom): do not throw in production on side effect tags

close #8287
close #8292
This commit is contained in:
Evan You 2023-05-12 10:25:37 +01:00
parent ab9256a4bb
commit c454b9d7f4
1 changed files with 7 additions and 3 deletions

View File

@ -7,9 +7,13 @@ export const ignoreSideEffectTags: NodeTransform = (node, context) => {
node.tagType === ElementTypes.ELEMENT &&
(node.tag === 'script' || node.tag === 'style')
) {
context.onError(
createDOMCompilerError(DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG, node.loc)
)
__DEV__ &&
context.onError(
createDOMCompilerError(
DOMErrorCodes.X_IGNORED_SIDE_EFFECT_TAG,
node.loc
)
)
context.removeNode()
}
}