$ npx degit sveltejs/template <app-name>
$ cd <app-name>
$ npm i
$ npm i svelte-routing sveltestrap
$ npm i firebase
$ npm i -D tailwindcss@latest postcss@latest autoprefixer@latest
$ npx tailwindcss init
tailwind.config.js
const production = !process.env.ROLLUP_WATCH;
module.exports = {
content: [
'./src/**/*.svelte',
'./src/**/*.html',
],
enabled: production,
theme: {
extend: {},
},
plugins: [],
}
$ npm i svelte-preprocess
rollup.config.js
import sveltePreprocess from 'svelte-preprocess';
export default {
plugins: [
svelte({
preprocess: sveltePreprocess({
sourceMap: !production,
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
}),
...
};
App.svelte
内のfirebaseConfig
に貼り付けpublic/index.html
に配置するらしい...でも適応されない...App.svelte
<script>
import { Router, Link, Route } from "svelte-routing";
import Home from "./pages/Home.svelte";
import About from "./pages/About.svelte";
</script>
<Router>
<nav>
<Link to="">home</Link>
<Link to="about">about</Link>
</nav>
<main>
<Route path="" component={Home} />
<Route path="about">
<About />
</Route>
</main>
</Router>
<style global lang="postcss">
@tailwind base;
@tailwind components;
@tailwind utilities;
</style>
Firebase → プロジェクト → Authentication → Sign-in method → 承認済みドメインにVercelのドメインを追加してください。
$ firebase init hosting
# setting
$ firebase deploy --only hosting
デプロイ取り消し
$ firebase hosting:disable