├── public
│ ├── favicon.ico
│ ├── global.css
│ ├── index.html
│ ├── robots.txt
├── src
│ ├── App.svelte
│ ├── index.js
├── .gitignore
├── snowpack.config.js
└── package.json
Created
October 21, 2020 04:52
-
-
Save frankievalentine/a33d0646a8a951082d9bc68945bb422f to your computer and use it in GitHub Desktop.
snowpack-svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
export let name; | |
</script> | |
<style> | |
h1 { | |
text-align: center; | |
} | |
</style> | |
<h1>Hello {name}!</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import App from "./App.svelte"; | |
const app = new App({ | |
target: document.body, | |
props: { | |
name: "Svelte", | |
}, | |
}); | |
export default app; | |
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR. | |
// Learn more: https://www.snowpack.dev/#hot-module-replacement | |
if (import.meta.hot) { | |
import.meta.hot.accept(); | |
import.meta.hot.dispose(() => { | |
app.$destroy(); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"start": "snowpack dev", | |
"build": "snowpack build", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugins": ["@snowpack/plugin-svelte"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir [dirname] | |
cd [dirname] | |
yarn init -y | |
git init | |
touch .gitignore && echo -e "node_modules\nyarn.lock\nyarn-error.log\ndist\n.cache\n.env" >> .gitignore | |
yarn add --dev snowpack svelte-check @snowpack/plugin-svelte @snowpack/plugin-run-script @snowpack/app-scripts-svelte | |
yarn add svelte | |
mkdir public && mkdir src && cd public && touch favicon.ico global.css index.html robots.txt | |
cd .. && cd src | |
touch App.svelte index.js && cd .. | |
touch snowpack.config.js | |
hub create | |
code . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment