chore: 优化 svgr 产出代码便于打包

This commit is contained in:
2betop 2023-07-18 19:04:20 +08:00
parent f7373c5abf
commit 82a22d1c8e
3 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ function transpileReactCreateElement() {
enforce: 'post',
transform: (code, id) => {
if (
/\.(?:t|j)sx/.test(id) &&
/\.(?:tsx|jsx|svg)$/.test(id) &&
code.indexOf('React.createElement') !== -1
) {
const separator = '\n\n;';

View File

@ -153,7 +153,7 @@ function transpileReactCreateElement() {
enforce: 'post',
transform: (code, id) => {
if (
/\.(?:t|j)sx/.test(id) &&
/\.(?:tsx|jsx|svg)$/.test(id) &&
code.indexOf('React.createElement') !== -1
) {
const separator = '\n\n;';

View File

@ -121,7 +121,7 @@ function transpileReactCreateElement() {
enforce: 'post',
transform: (code, id) => {
if (
/\.(?:t|j)sx/.test(id) &&
/\.(?:tsx|jsx|svg)$/.test(id) &&
code.indexOf('React.createElement') !== -1
) {
const separator = '\n\n;';