commit
8446f437c0
15 changed files with 168 additions and 0 deletions
@ -0,0 +1,15 @@
|
||||
module.exports = { |
||||
root: true, |
||||
extends: ['eslint:recommended', 'prettier'], |
||||
plugins: ['svelte3'], |
||||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], |
||||
parserOptions: { |
||||
sourceType: 'module', |
||||
ecmaVersion: 2019 |
||||
}, |
||||
env: { |
||||
browser: true, |
||||
es2017: true, |
||||
node: true |
||||
} |
||||
}; |
@ -0,0 +1,5 @@
|
||||
.DS_Store |
||||
node_modules |
||||
/build |
||||
/.svelte-kit |
||||
/package |
@ -0,0 +1,6 @@
|
||||
{ |
||||
"useTabs": true, |
||||
"singleQuote": true, |
||||
"trailingComma": "none", |
||||
"printWidth": 100 |
||||
} |
@ -0,0 +1,38 @@
|
||||
# create-svelte |
||||
|
||||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte); |
||||
|
||||
## Creating a project |
||||
|
||||
If you're seeing this, you've probably already done this step. Congrats! |
||||
|
||||
```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 |
||||
|
||||
Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then: |
||||
|
||||
```bash |
||||
npm run build |
||||
``` |
||||
|
||||
> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production. |
@ -0,0 +1,10 @@
|
||||
{ |
||||
"compilerOptions": { |
||||
"baseUrl": ".", |
||||
"paths": { |
||||
"$lib": ["src/lib"], |
||||
"$lib/*": ["src/lib/*"] |
||||
} |
||||
}, |
||||
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] |
||||
} |
@ -0,0 +1,27 @@
|
||||
{ |
||||
"name": "~TODO~", |
||||
"version": "0.0.1", |
||||
"scripts": { |
||||
"dev": "svelte-kit dev", |
||||
"build": "svelte-kit build", |
||||
"preview": "svelte-kit preview", |
||||
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", |
||||
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." |
||||
}, |
||||
"devDependencies": { |
||||
"@sveltejs/kit": "next", |
||||
"eslint": "^7.22.0", |
||||
"eslint-config-prettier": "^8.1.0", |
||||
"eslint-plugin-svelte3": "^3.2.0", |
||||
"prettier": "~2.2.1", |
||||
"prettier-plugin-svelte": "^2.2.0", |
||||
"svelte": "^3.34.0", |
||||
"postcss": "^8.3.5", |
||||
"postcss-load-config": "^3.1.0", |
||||
"svelte-preprocess": "^4.7.4", |
||||
"autoprefixer": "^10.3.1", |
||||
"cssnano": "^5.0.6", |
||||
"tailwindcss": "^2.2.4" |
||||
}, |
||||
"type": "module" |
||||
} |
@ -0,0 +1,20 @@
|
||||
const tailwindcss = require("tailwindcss"); |
||||
const autoprefixer = require("autoprefixer"); |
||||
const cssnano = require("cssnano"); |
||||
|
||||
const mode = process.env.NODE_ENV; |
||||
const dev = mode === "development"; |
||||
|
||||
const config = { |
||||
plugins: [ |
||||
//Some plugins, like postcss-nested, need to run before Tailwind, |
||||
tailwindcss(), |
||||
//But others, like autoprefixer, need to run after, |
||||
autoprefixer(), |
||||
!dev && cssnano({ |
||||
preset: "default", |
||||
}) |
||||
], |
||||
}; |
||||
|
||||
module.exports = config; |
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8" /> |
||||
<link rel="icon" href="/favicon.png" /> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
||||
%svelte.head% |
||||
</head> |
||||
<body> |
||||
<div id="svelte">%svelte.body%</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,4 @@
|
||||
@tailwind base; |
||||
/* Write your global styles here, in PostCSS syntax */ |
||||
@tailwind components; |
||||
@tailwind utilities |
@ -0,0 +1,2 @@
|
||||
<script>import "../app.postcss";</script> |
||||
<slot></slot> |
@ -0,0 +1,2 @@
|
||||
<h1>Welcome to SvelteKit</h1> |
||||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> |
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,14 @@
|
||||
import preprocess from "svelte-preprocess"; |
||||
/** @type {import('@sveltejs/kit').Config} */ |
||||
const config = { |
||||
kit: { |
||||
// hydrate the <div id="svelte"> element in src/app.html
|
||||
target: '#svelte' |
||||
}, |
||||
|
||||
preprocess: [preprocess({ |
||||
"postcss": true |
||||
})] |
||||
}; |
||||
|
||||
export default config; |
Loading…
Reference in new issue