Last active
June 20, 2022 21:38
-
-
Save nickserv/80c1540b752c4df421305be51251558a to your computer and use it in GitHub Desktop.
Simple Vite-like app template for esbuild
This file contains 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
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
pnpm-debug.log* | |
lerna-debug.log* | |
node_modules | |
dist | |
dist-ssr | |
*.local | |
# Editor directories and files | |
.vscode/* | |
!.vscode/extensions.json | |
.idea | |
.DS_Store | |
*.suo | |
*.ntvs* | |
*.njsproj | |
*.sln | |
*.sw? |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<link rel="icon" type="image/svg+xml" href="https://esbuild.github.io/favicon.svg" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>esbuild App</title> | |
<link rel="stylesheet" href="/dist/main.css"> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script type="module" src="/dist/main.js"></script> | |
</body> | |
</html> |
This file contains 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 './style.css' | |
document.querySelector('#app').innerHTML = ` | |
<h1>Hello esbuild!</h1> | |
<a href="https://esbuild.github.io/" target="_blank">Documentation</a> | |
` |
This file contains 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
{ | |
"name": "esbuild-app", | |
"private": true, | |
"version": "0.0.0", | |
"scripts": { | |
"dev": "yarn build --servedir=.", | |
"build": "esbuild ./main --bundle --outdir=dist", | |
"preview": "serve" | |
}, | |
"dependencies": { | |
"react": "^18.0.0", | |
"react-dom": "^18.0.0" | |
}, | |
"devDependencies": { | |
"esbuild": "^0.14.46", | |
"serve": "^13.0.2" | |
} | |
} |
This file contains 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
#app { | |
font-family: Avenir, Helvetica, Arial, sans-serif; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
text-align: center; | |
color: #2c3e50; | |
margin-top: 60px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment