This commit is contained in:
nvms 2024-10-09 17:02:33 -04:00
parent 81b941558c
commit 1cb6dad511
2 changed files with 17 additions and 3 deletions

View File

@ -13,8 +13,21 @@
This is a simple esbuild-powered dev server. It has livereloading. It's fast. It's configured with YAML.
For the minimalist. For the developer who misses the old web. For the developer who is tired of configuring your build tools.
## Quickstart
```bash
$ esr --serve src/index.ts
esr :: Serving on http://localhost:1234
```
`src/index.ts` is bundled with esbuild and included in the HTML page served at the URL above.
## Example configuration
These are all defaults. You don't need to do any of this. You can if you want to, but you don't have to.
```yml
# Defaults
bundle: true

View File

@ -10,12 +10,13 @@ var indexHtml = `<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>esr</title>
<title>Application</title>
{{ css }}
</head>
<body>
<div id="app"></div>
<script src="index.js" type="module"></script>
{{ livereload }}
{{ js }}
</body>
</html>`
@ -26,7 +27,7 @@ sourcemap: true
outdir: public
watch:
paths: ['src/**/*.{ts,tsx,js,jsx,css,scss,html}']
paths: ['src/**/*.{ts,tsx,js,jsx,css,scss,html}', 'public/index.html']
serve:
html: public/index.html