Simplify create-svelte
See original GitHub issueRecapping 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:
- Created 2 years ago
- Reactions:4
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
They’re absolutely vital so long as nesting isn’t part of the spec!