kt3k / packup

📦 Zero-config web application packager for Deno
https://packup.deno.dev/
MIT License
327 stars 18 forks source link
deno esbuild frontend packup typescript

packup v0.2.6

ci codecov

Zero-config web application packager for Deno.

Features

Usage

Install via deno.land/x:

deno install -qAf https://deno.land/x/packup@v0.2.6/cli.ts

Write HTML and JavaScript:

index.html

<html>
  <body>
    <script src="https://github.com/kt3k/packup/raw/main/main.ts"></script>
    <h1>Hi from packup!</h1>
  </body>
</html>

main.ts

console.log("hello world");

packup has the development server builtin. Run the following command to start the server.

packup index.html

Then open http://localhost:1234/ in your browser.

See packup serve -h and packup build -h for more usages.

Typings

You can type check the script with Deno.

You need the following tsconfig.json for your frontend scripts correctly type checked.

{
  "compilerOptions": {
    "lib": ["esnext", "dom"]
  }
}

If you use vscode you need to set 'deno.config' property in .vscode/settings.json file to point the tsconfig.json:

{
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": true,
  "deno.config": "./tsconfig.json"
}

If you'd prefer to use CLI directly to type check your script, you can use the following command for it:

deno cache --config tsconfig.json <script>

See the example repository for more details.

1.0 roadmap

Prior art

History

License

MIT