@@ -30,7 +30,7 @@ import { prune } from './css/css-prune.js';
3030import { hash } from './utils.js' ;
3131import { warn_unused } from './css/css-warn.js' ;
3232import { extract_svelte_ignore } from '../../utils/extract_svelte_ignore.js' ;
33- import { pop_ignore , push_ignore } from '../../state.js' ;
33+ import { ignore_map , ignore_stack , pop_ignore , push_ignore } from '../../state.js' ;
3434
3535/**
3636 * @param {import('#compiler').Script | null } script
@@ -1107,6 +1107,7 @@ function is_safe_identifier(expression, scope) {
11071107/** @type {import('./types').Visitors } */
11081108const common_visitors = {
11091109 _ ( node , { state, next, path } ) {
1110+ ignore_map . set ( node , structuredClone ( ignore_stack ) ) ;
11101111 const parent = path . at ( - 1 ) ;
11111112 if ( parent ?. type === 'Fragment' && node . type !== 'Comment' && node . type !== 'Text' ) {
11121113 const idx = parent . nodes . indexOf ( /** @type {any } */ ( node ) ) ;
@@ -1129,6 +1130,7 @@ const common_visitors = {
11291130
11301131 if ( ignores . length > 0 ) {
11311132 push_ignore ( ignores ) ;
1133+ ignore_map . set ( node , structuredClone ( ignore_stack ) ) ;
11321134 next ( ) ;
11331135 pop_ignore ( ) ;
11341136 }
@@ -1148,6 +1150,7 @@ const common_visitors = {
11481150 }
11491151 if ( ignores . length > 0 ) {
11501152 push_ignore ( ignores ) ;
1153+ ignore_map . set ( node , structuredClone ( ignore_stack ) ) ;
11511154 next ( ) ;
11521155 pop_ignore ( ) ;
11531156 }
0 commit comments