- Create the
~/bin
directory if it doesn't exist - Clone this repository to
~/bin/svelte-icon-init
- Run these commands in in
~/bin/svelte-icon-init
nvm install
npm install
- Add this function in
~/.zshrc
svelte () {
if (($# == 0))
then
echo "Usage: svelte <project-name>"
return 1
fi
echo "Initializing new svelte project with tailwind and icons in $1"
cd $(node ~/bin/svelte-icon-init/index.mjs $1 | tail -1)
code .
npm run dev -- --open
}
- Open a new terminal and run
svelte <project-name>
to initialize a new project