Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SvelteKit Production Build #103

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules
/.svelte
/build
/functions
/functions
/.vercel_build_output
48 changes: 10 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,14 @@
# create-svelte
# Zaahir Moolla - Personal Website

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte);
This is my personal website. You can check it out here: https://zaahir.ca

## Creating a project
The design was mostly borrowed from https://wrapbootstrap.com/theme/articulate-resume-portfolio-WB0N5LC7P.

If you're seeing this, you've probably already done this step. Congrats!
## Built with:

```bash
# create a new project in the current directory
npm init svelte@next

# create a new project in my-app
npm init svelte@next my-app
```

> Note: the `@next` is temporary

## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

Svelte apps are built with _adapters_, which optimise your project for deployment to different environments.

By default, `npm run build` will generate a Node app that you can run with `node build`. To use a different adapter, add it to the `devDependencies` in `package.json` making sure to specify the version as `next` and update your `svelte.config.cjs` to [specify your chosen adapter](https://kit.svelte.dev/docs#configuration-adapter). The following official adapters are available:

- [@sveltejs/adapter-node](https://github.com/sveltejs/kit/tree/master/packages/adapter-node)
- [@sveltejs/adapter-static](https://github.com/sveltejs/kit/tree/master/packages/adapter-static)
- [@sveltejs/adapter-netlify](https://github.com/sveltejs/kit/tree/master/packages/adapter-netlify)
- [@sveltejs/adapter-vercel](https://github.com/sveltejs/kit/tree/master/packages/adapter-vercel)
- ...more soon

[See the adapter documentation for more detail](https://kit.svelte.dev/docs#adapters)
- [SvelteKit](https://kit.svelte.dev)
- [Tailwind.css](https://tailwindcss.com)
- [Hover.css](https://ianlunn.github.io/Hover)
- [icons8](https://icons8.com)
- [Vercel](https://vercel.com/home)
- [Fathom Analytics](https://usefathom.com)
2 changes: 1 addition & 1 deletion postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const dev = mode === 'development';
module.exports = {
plugins: [
require('postcss-import'),
require('tailwindcss'),
require('postcss-nested'),
require('tailwindcss'),
// require('postcss-custom-properties'),
require('autoprefixer'),

Expand Down
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%svelte.head%
</head>
Expand Down
2 changes: 1 addition & 1 deletion svelte.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const sveltePreprocess = require('svelte-preprocess');
const static = require('@sveltejs/adapter-static');
// const static = require('@sveltejs/adapter-static');
const vercel = require('@sveltejs/adapter-vercel');
const pkg = require('./package.json');

Expand Down
5 changes: 4 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const { tailwindExtractor } = require('tailwindcss/lib/lib/purgeUnusedStyles');

const mode = process.env.NODE_ENV;
const dev = mode === 'development';

module.exports = {
mode: 'jit',
mode: dev && 'jit',
purge: {
content: ['./src/**/*.{html,js,svelte,ts}'],
options: {
Expand Down