├── public
│ ├── favicon.ico
│ ├── global.css
│ ├── robots.txt
├── src
│ ├── App.svelte
│ ├── index.js
├── index.html
└── package.json
Last active
October 21, 2020 05:25
-
-
Save frankievalentine/563b7f8230da08e5fcc5d4856cff67ab to your computer and use it in GitHub Desktop.
svelte-parcel
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>Svelte with Parcel</title> | |
<link rel="stylesheet" href="./css/styles.scss"> | |
</head> | |
<body> | |
<script src="./index.js"></script> | |
</body> | |
</html> |
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; |
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
"browserslist": [ | |
"last 1 chrome versions" | |
], | |
"scripts": { | |
"dev": "parcel src/index.html", | |
"build": "parcel build src/index.html" | |
} |
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 -D svelte parcel-plugin-svelte parcel-bundler @babel/polyfill | |
mkdir src && cd src && mkdir components && mkdir css | |
cd .. | |
touch index.html index.js | |
cd components && touch App.svelte && cd .. && cd css && touch index.scss && cd .. | |
code . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment