diff --git a/packages/amis-core/rollup.config.js b/packages/amis-core/rollup.config.js index 257181e0f..b8f611025 100644 --- a/packages/amis-core/rollup.config.js +++ b/packages/amis-core/rollup.config.js @@ -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;'; diff --git a/packages/amis-ui/rollup.config.js b/packages/amis-ui/rollup.config.js index 82159abdf..527df261a 100644 --- a/packages/amis-ui/rollup.config.js +++ b/packages/amis-ui/rollup.config.js @@ -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;'; diff --git a/packages/amis/rollup.config.js b/packages/amis/rollup.config.js index 99479f399..5340797ae 100644 --- a/packages/amis/rollup.config.js +++ b/packages/amis/rollup.config.js @@ -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;';