File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
packages/enhanced-img/src Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sveltejs/enhanced-img ' : patch
3+ ---
4+
5+ fix: address Svelte 5 warning
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as path from 'node:path';
33
44import MagicString from 'magic-string' ;
55import { asyncWalk } from 'estree-walker' ;
6+ import { VERSION } from 'svelte/compiler' ;
67import { parse } from 'svelte-parse-markup' ;
78
89// TODO: expose this in vite-imagetools rather than duplicating it
@@ -159,7 +160,9 @@ export function image(opts) {
159160 // @ts -ignore
160161 s . appendLeft ( ast . module . content . start , text ) ;
161162 } else {
162- s . prepend ( `<script context="module">\n${ text } </script>\n` ) ;
163+ s . prepend (
164+ `<script ${ VERSION . startsWith ( '4' ) ? 'context="module"' : 'module' } >\n${ text } </script>\n`
165+ ) ;
163166 }
164167 }
165168
You can’t perform that action at this time.
0 commit comments