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.76k stars 151 forks source link

cannot use pug template inheritance #459

Open benblazak opened 2 years ago

benblazak commented 2 years ago

bug

cannot use pug template inheritance

test

sample repo: https://github.com/benblazak/_svelte_preprocess__pug_template_inheritance

git clone https://github.com/benblazak/_svelte_preprocess__pug_template_inheritance.git
cd _svelte_preprocess__pug_template_inheritance
npm install
npm run dev -- --open

ideas

i think the reason extends ... is not the first thing in the file is because the svelte mixins are prepended here: https://github.com/sveltejs/svelte-preprocess/blob/a239e829295bde5f62383697266cefe7767dd0e2/src/transformers/pug.ts#L68

Minasokoni commented 1 year ago

@benblazak Have you found a solution to this issue? This is the exact issue i'm running into

benblazak commented 1 year ago

@Minasokoni I needed the practice, so i submitted a pull request. Till then you can use the branch -- or feel free to improve it (no matter who get's the PR credit, if they're willing to accept a fix) I may not have time to do more than this first submission.