Skip to content

Commit

Permalink
fix: image?jsx strip export default (#4541)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Jun 20, 2023
1 parent 71b8384 commit c0303d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/qwik-city/buildtime/vite/image-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ export function imagePlugin(): PluginOption[] {
id = id.toLowerCase();
if (id.endsWith('?jsx')) {
if (supportedExtensions.some((ext) => id.endsWith(ext))) {
return code.replace(
/export default.*/g,
const index = code.indexOf('export default');
return (
code.slice(0, index) +
`
import { _jsxQ } from '@builder.io/qwik';
const PROPS = {decoding: 'async', loading: 'lazy', srcSet, width, height};
Expand Down

0 comments on commit c0303d3

Please sign in to comment.