https://github.com/sveltejs/svelte-cli
Command line interface for Svelte
https://github.com/sveltejs/svelte-cli
Last synced: about 2 months ago
JSON representation
Command line interface for Svelte
- Host: GitHub
- URL: https://github.com/sveltejs/svelte-cli
- Owner: sveltejs
- License: mit
- Archived: true
- Created: 2016-11-27T01:11:50.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T01:21:22.000Z (over 7 years ago)
- Last Synced: 2024-04-14T16:06:24.504Z (over 1 year ago)
- Language: JavaScript
- Size: 115 KB
- Stars: 104
- Watchers: 9
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# svelte-cli
Command line interface for [Svelte](https://svelte.technology).
## DEPRECATION NOTE
As of Svelte version 2.4.0, the CLI is integrated into the `svelte` package itself, and this package should no longer be used.
## Why you shouldn't use this
`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](https://rollupjs.org) (with [rollup-plugin-svelte](https://github.com/rollup/rollup-plugin-svelte)), [Webpack](https://webpack.js.org) (with [svelte-loader](https://github.com/sveltejs/svelte-loader)), or another integration [listed here](https://github.com/sveltejs/svelte#svelte). [See here](https://svelte.technology/blog/the-easiest-way-to-get-started) for an easy get-started guide.
## Installation
```bash
npm install -g svelte-cli
```
## Usage
```bash
# 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
```
## License
[MIT](LICENSE)