question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Simplify create-svelte

See original GitHub issue

Recapping some discussion in Discord prompted by #934:

  • our current approach does not scale. the code is already a bit convoluted, #934 makes it more so just by virtue of adding an additional template. if we wanted to add more templates in future, or support (for example) specifying a github repo as a template, things would get out of hand quickly
  • i’m of the view, and my sense is that at least most of the core team agree, that encouraging CSS preprocessors like SCSS and LESS is undesirable. they’re just not really necessary in a world of scoped component styles and CSS custom properties. if people really want to make their apps more complex by throwing preprocessors at them, they are welcome to do so, but npm init svelte is the wrong place to make that happen
  • therefore the only source code modification that needs to happen is TypeScript
  • rather than manually writing code that modifies the template, which works in trivial cases but is generally a bit distasteful, we could maintain a TypeScript version of each template and convert it to JavaScript at build time instead (e.g. by running all the .ts files and the <script> of each .svelte file through Sucrase or esbuild)
  • there’s still some modification that needs to happen to package.json, and there’s still some complexity around Prettier and ESLint (the Prettier modifier depends on whether you’re using the ESLint modifier, which depends on whether you’re using TypeScript) but it’s stuff that should in theory be common to all projects, and is therefore immune to the aforementioned scaling issue
  • if we’re transforming the template code at build time, we don’t really need to include the actual template files in the package, we can just create a JSON file with the contents

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
babichjacobcommented, Apr 13, 2021

In my opinion nested syntax is a good reason to keep built-in support for Less/Sass. Is there a way to remove it from create-svelte but still make it easily available simply with <style lang='scss'> ?

Install and set up svelte-preprocess and its needed dependencies yourself.

If it’s so necessary, someone in the community’s probably going to make a Svelte adder for it anyway.

1reaction
pikeascommented, Apr 13, 2021
  • they’re just not really necessary in a world of scoped component styles and CSS custom properties.

They’re absolutely vital so long as nesting isn’t part of the spec!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create Svelte Component Libraries with SvelteKit
How to Create Svelte Component Libraries with SvelteKit. Simplify the process of making Svelte modules with SvelteKit. Image by Text To Photo Editor....
Read more >
Install for [ 'create-svelte@next' ] failed with code 1
I am a newbie to svelte and trying to learn about it but I couldn't set up the project from the beginning. When...
Read more >
How to create and publish Svelte components (English)
How to use the template to create Svelte componentsPermalink. Obviously all this work is to create a template that simplifies the creation of ......
Read more >
Create Svelte + Typescript + tailwindcss Project(feat. error ...
Step 2 : Solve tailwindcss error. Error log. npm install npm run dev 오후 6:33:35 [vite] Internal server error: [postcss] ENOENT: no such ......
Read more >
Simplify Calculator - Mathway
The simplification calculator allows you to take a simple or complex expression and simplify and reduce the expression to it's simplest form.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found