create-svelte-with-config

1.0.2 • Public • Published

create-svelte-with-config

This is a thin wrapper of create-svelte.

Why

create-svelte currently doesn't accept a config file nor command flags. That leaves you with either enter things interactively or setup a project like this very one to tap into create-svelte programmatically which is not ideal.

So until that feature is added to upstream, this project should be useful to create svelte project quickly without having to interactively providing parameters.

Examples

Example With a Config With Hard-Coded Project Name

// let's say this is your-config-file.mjs in your current working directory

// based on https://github.com/sveltejs/kit/tree/master/packages/create-svelte#api
export default { // always export this as default
  name: 'my-new-app-via-config',
  template: 'skeleton', // or 'default' or 'skeletonlib'
  types: 'typescript', // or 'checkjs' or null;
  vitest: true,
  eslint: true,
  prettier: true,
  playwright: false,
};

Then now you can run this

npm create svelte-with-config your-config-file.mjs

Example With Overriding Name

// let's say this is another-config-file.mjs

export default {
  name: 'still-hard-coded-name-in-config',
  template: 'skeleton', // or 'default' or 'skeletonlib'
  types: 'typescript', // or 'checkjs' or null;
  vitest: false,
  eslint: false,
  prettier: false,
  playwright: false,
};

Then now you can run this to override the name

npm create svelte-with-config another-config-file.mjs my-another-new-app

Readme

Keywords

Package Sidebar

Install

npm i create-svelte-with-config

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

3.9 kB

Total Files

5

Last publish

Collaborators

  • ryuheechul