sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

fix: support pug extends #599

Open simiraaaa opened 1 year ago

simiraaaa commented 1 year ago

*Machine translation from Japanese to English at DeepL.

459

572

I came up with a solution to the above Issue and PR. Use pug-lexer to extract the line with the extends syntax and move it to the top line. This will work even with comments and prependData.

I think it needs to be tested, but I have not written it because I do not know how to write it correctly. I would appreciate it if you could add it to this PR or create it separately.

Tests