Command line interface for Svelte.
As of Svelte version 2.4.0, the CLI is integrated into the svelte
package itself, and this package should no longer be used.
svelte-cli
is useful if you want to try out Svelte, but it's not recommended for serious production use. It will compile your components to standalone JavaScript files, but won't automatically recompile them when they change, and won't deduplicate code shared between your components.
Instead, we recommend using a bundler such as Rollup (with rollup-plugin-svelte), Webpack (with svelte-loader), or another integration listed here. See here for an easy get-started guide.
npm install -g svelte-cli
# get help
svelte --help
# generate a JavaScript module from MyComponent.html
svelte compile MyComponent.html > MyComponent.js
svelte compile -i MyComponent.html -o MyComponent.js
# generate a UMD module from MyComponent.html, inferring
# name from the filename ('MyComponent')
svelte compile -f umd MyComponent.html > MyComponent.js
# generate a UMD module, specifying the name
svelte compile -f umd -n CustomName MyComponent.html > MyComponent.js
# compile all .html files in components/
svelte compile -i src/components -o build/components
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型