A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
by sveltejsLast 12 weeks · 0 commits
5 of 6 standards met
Describe the bug To Reproduce Using shadcn-svelte with live_svelte and when running the server esbuild fails with the described error. I have narrowed it down to debounced.svelte.js which contains a comment that references This seems to be the trigger of the issue that is likely not being properly handled in . I have created a patch package to unblock but wanted to report to see if anybody has any idea where the root cause might be? patch: Information about your project:** System: OS: macOS 15.1.1 CPU: (12) arm64 Apple M3 Pro Memory: 94.34 MB / 36.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm pnpm: 10.9.0 - /opt/homebrew/bin/pnpm bun: 1.2.10 - /opt/homebrew/bin/bun Browsers: Brave Browser: 119.1.60.114 Chrome: 135.0.7049.97 Safari: 18.1.1 npmPackages: svelte: ^5.28.2 => 5.28.2 svelte-preprocess: ^6.0.3 => 6.0.3
Fixes #459. Allows for pug template inheritance. The issue was that statements must occur first in a pug file, but the svelte mixins were being inserted at the top of the file contents before being passed to pug. I made changes so that if an statement occurs as the first line in a file, it is split off from the rest of the content and inserted before the svelte mixins. [x] test [x] lint notes I wasn't able to research or test whether there are other things that should also be kept before svelte mixins.
Repository: sveltejs/svelte-preprocess. Description: A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more. Stars: 1788, Forks: 145. Primary language: TypeScript. Languages: TypeScript (99.7%), JavaScript (0.3%). License: MIT. Topics: preprocess, svelte, sveltejs, sveltekit. Open PRs: 7, open issues: 75. Last activity: 1y ago. Community health: 75%. Top contributors: kaisermann, dummdidumm, dependabot[bot], benmccann, illright, bluwy, pngwn, milahu, Andarist, mcmxcdev and others.
TypeScript
When importing scss files from , like so in my file: I get the error if the file I imported from my svelte app has any imports itself, such as or . This breaks the app when trying to use packages like since they fully embrace the SCSS module system in their packages. Svelte doesn't seem to have any problems with the SCSS module system when used within the directory, i.e. as it is able to resolve or with no problem, but as soon as a file is imported from that first file is resolved, while all others that the imported file imports can't be found. That makes me think that there is some kind of configuration(?) that I may be missing, but all the solutions I've found while digging don't appear to work. Expected behavior You should be able to import an SCSS file from node_modules and have it resolve all of it's own imports for use in your app. Information about your project: Ubuntu Linux 20.04 version 4.10.2 Sveltekit v1.0.0-next.257
Describe the bug** When there is a `lang="ts"vitePreprocess@sveltejs/vite-plugin-svelte__svelte_metasvelte-preprocess@sveltejs/vite-plugin-sveltesvelte.config.jsvite.config.ts+page.sveltelang="ts"__svelte_metasvelte-preprocess` version: 6.0.3 Whether your project uses Webpack or Rollup - Vite with Rollup
Is your feature request related to a problem? Please describe. Typescript transpilation gets slow, quickly. Describe the solution you'd like esbuild is currently the fastest way to transform typescript into javascript. It's a few orders of magnitude faster than tsc or babel. Using esbuild would help keep the developer experience snappy and not punish developers for choosing typescript. Describe alternatives you've considered Snowpack looks promising, and uses esbuild to transform ts/tsx, but their svelte setup doesn't support typescript without using svelte-preprocess. That means we're back to running things through tsc or babel, and affects some of the dev experience. How important is this feature to you? Anything that makes developer feedback fast is extremely valuable to me, and to everyone I imagine.