x/packup@v0.1.13/README.md
Zero-config web application packager in Deno.
Install via deno.land/x:
deno run -A https://deno.land/x/packup@v0.1.13/install.ts
Write HTML and JavaScript:
index.html
<html>
<body>
<script src="./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.
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.
If you want to use packup without installing globally, you can use the following command.
deno run --allow-env --allow-read --allow-write --allow-net=deno.land https://deno.land/x/packup@v0.1.13/ensure_esbuild_wasm.ts
deno run -A https://deno.land/x/packup@v0.1.13/cli.ts <your parameters>
The first command ensures the esbuild wasm installed on your machine. The second command is the actual entrypoint of the packup program.
@import
support<img>
srcset
attribute and <source>
tag. #39DENO_DIR
when it's specified. #31--static-dist-prefix
option #30--public-url
option #29ensure_esbuild_wasm.ts
entrypoint.iterable_file_server
MIT