A starter template using svelte, routify, tailwindcss and typescript Like my work? Will you buy me a coffee? https://www.buymeacoffee.com/analu
!!! DISCLAIMER !!!
This is not compatible with either Firebase or Amplify, I believe it's because of Routify. I'm working on a new template that should work with both. As soon as I have something I'll post it here.
This is deprecated, please use either: (New Svelte Starter)[https://github.com/analubarreto/new-svelte-starter] or (SvelteKit Tailwind Starter)[https://github.com/analubarreto/sveltekit-tailwind-starter]
git@github.com:analubarreto/svelte-starter.git
Create a new project clicking "Use this template" (method 2)
Install dependencies (method 1 and 2)
npm install
git remote rm <remote-name>
git remote add origin git@github.com:{your_user_name}/{your_repo}.git
Note that you should remove the curly braces for this to work. 7. Start the project (method 1 and 2)
npm run dev
This is not a necessary folder, but it is advised you put your components here.
This is a necessary folder where routes are created. It's advised to create a folder like blog with a index and [content].svelte only if you have a route with dynamic sub routes.
In your root folder add .nolluprc.js with this code:
module.exports = {
hot: true,
contentBase: 'assets',
publicPath: 'build',
historyApiFallback: '__app.html',
port: 5000
}
// Env variables
replace({
process: JSON.stringify({
env: {
// EXAMPLE => API_URL: process.env.API_URL,
...config().parsed
}
})
}),
** There is an example of use inside Post.svelte
PWAs only run on a production environment, so if you are testing this on localhost you have to go through these steps:
npm run build
npm run serve
Lazy image loading has been added, the file lazySize.js inside util is responsible for it. It is rendered inside __app.html. To use it in your images follow the example below:
<img src="image-source" alt="alt-text" class="lazyload" />
Um modelo inicial usando svelte, routify, tailwindcss e typescript Isso está obsoleto, por favor, use: (New Svelte Starter)[https://github.com/analubarreto/new-svelte-starter] ou (SvelteKit Tailwind Starter)[https://github.com/analubarreto/sveltekit-tailwind-starter]
git@github.com:analubarreto/svelte-starter.git
npm install
git remote rm <remote-name>
git remote add origin git@github.com: {your_user_name} / {your_repo} .git
Observe que você deve remover as chaves para que isso funcione. 7. Inicie o projeto (método 1)
npm run dev
Esta pasta não é necessária, mas é recomendado que você coloque seus componentes aqui.
Esta é uma pasta necessária onde as rotas são criadas. É aconselhável criar uma pasta como blog com um índice e [conteudo].svelte apenas se você tiver uma rota com rotas secundárias dinâmicas.
Na raiz do seu projeto adicione .nolluprc.js com esse código:
module.exports = {
hot: true,
contentBase: 'assets',
publicPath: 'build',
historyApiFallback: '__app.html',
port: 5000
}
// Env variables
replace({
process: JSON.stringify({
env: {
// EXAMPLE => API_URL: process.env.API_URL,
...config().parsed
}
})
}),
O carregamento lento da imagem foi adicionado, o arquivo lazySize.js dentro do util é responsável por isso. Ele é renderizado dentro de __app.html. Para utilizá-lo em suas imagens siga o exemplo abaixo:
<img src="image-source" alt="alt-text" class="lazyload" />
Os PWAs são executados apenas em um ambiente de produção, portanto, se você estiver testando no localhost, siga estas etapas:
npm run build
npm run serve
Una plantilla de inicio que utiliza svelte, routify, tailwindcss y typescript
Esto está obsoleto, por favor use: (New Svelte Starter)[https://github.com/analubarreto/new-svelte-starter] o (SvelteKit Tailwind Starter)[https://github.com/analubarreto/sveltekit-tailwind-starter]
git@github.com:analubarreto/svelte-starter.git
npm install
git remote rm <remote-name>
git remote add origin git@github.com: {su_numbre} / {su_repo} .git
Tenga en cuenta que debe quitar las llaves para que esto funcione. 7. Inicie el proyecto (método 1 y 2)
npm run dev
Esta no es una carpeta necesaria, pero se recomiends que coloque sus componentes aquí.
Esta es una carpeta necesaria donde se crean las rutas. Se recomienda crear una carpeta como blog con un índice y [contenido].svelte solo si tiene una ruta con subrutas dinámicas.
En la raíz de su proyecto, agregue .nolluprc.js con este código:
module.exports = {
hot: true,
contentBase: 'assets',
publicPath: 'build',
historyApiFallback: '__app.html',
port: 5000
}
// Env variables
replace({
process: JSON.stringify({
env: {
// EXAMPLE => API_URL: process.env.API_URL,
...config().parsed
}
})
}),
** Hay un ejemplo de uso dentro de Post.svelte
Los PWA solo se ejecutan en un entorno de producción, por lo que si está probando esto en localhost, debe seguir estos pasos:
npm run build
npm run serve
Se ha agregado la carga diferida de imágenes, el archivo lazySize.js dentro de util es responsable de ello. Se representa dentro de __app.html. Para usarlo en tus imágenes sigue el siguiente ejemplo:
<img src="image-source" alt="alt-text" class="lazyload" />