sv create
sv create 设置一个新的 SvelteKit 项目,并提供 设置附加功能 选项。
¥sv create sets up a new SvelteKit project, with options to setup additional functionality.
用法(Usage)
¥Usage
npx sv create [options] [path]选项(Options)
¥Options
--from-playground <url>
从 playground URL 创建 SvelteKit 项目。这将下载所有 Playground 文件,检测外部依赖,并设置完整的 SvelteKit 项目结构,一切准备就绪。
¥Create a SvelteKit project from a playground URL. This downloads all playground files, detects external dependencies, and sets up a complete SvelteKit project structure with everything ready to go.
示例:
¥Example:
npx sv create --from-playground="https://svelte.kfwddq.com/playground/hello-world"--template <name>
使用哪个项目模板:
¥Which project template to use:
minimal— 为你的新应用搭建基本框架¥
minimal— barebones scaffolding for your new appdemo— 展示带有猜词游戏的应用,无需 JavaScript 即可运行¥
demo— showcase app with a word guessing game that works without JavaScriptlibrary— Svelte 库的模板,使用svelte-package设置¥
library— template for a Svelte library, set up withsvelte-package
--types <option>
是否以及如何向项目添加类型检查:
¥Whether and how to add typechecking to the project:
ts— 默认为.ts文件,对.svelte组件使用lang="ts"¥
ts— default to.tsfiles and uselang="ts"for.sveltecomponentsjsdoc— 对类型使用 JSDoc 语法¥
jsdoc— use JSDoc syntax for types
--no-types
防止添加类型检查。不推荐!
¥Prevent typechecking from being added. Not recommended!
--add [add-ons...]
在 create 命令中向项目添加插件。遵循与 sv add 相同的格式。
¥Add add-ons to the project in the create command. Following the same format as sv add.
示例:
¥Example:
npx sv create --add eslint prettier [path]--no-add-ons
在没有交互式附加组件提示的情况下运行命令
¥Run the command without the interactive add-ons prompt
--install <package-manager>
使用指定的包管理器安装依赖:
¥Installs dependencies with a specified package manager:
npmpnpmyarnbundeno
--no-install
阻止安装依赖。
¥Prevents installing dependencies.
--no-dir-check
跳过检查目标目录是否为空。
¥Skip checking whether the target directory is empty.