A lightweight development server for modern web apps.
npm install @zipadee/dev-serverA simple dev-server CLI.
zpd is a web development server built with Zipadee. It serves JavaScript files
and rewrites npm-style module specifiers to be browser-compatible by resolving them to
on-disk paths.
```
zpd [options]
Options:
- --port, -p The port to listen on. (default: 8080)--root
- , -r Root directory to serve files from. (default: Current working directory)--base
- , -b Base directory to resolve paths and imports from, as a relative path--css-modules
from the root directory. (default: '')
- Whether to transform CSS modules to JavaScript.
If true, CSS imports - imports with a type: 'css' import attribute - will be transformed to remove the type: 'css' attribute and add a ?type=css--module query parameter to the URL.--help
Requests for these URLs will be served as JavaScript modules that export the CSS as a CSSStyleSheet object. (default: false)
- Show the help message (default: false)
zpd serves files from the specified root directory (default: cwd).
Absolute paths and JavaScript module specifiers are resolved relative to the
base directory if set, otherwise to the root directory. If a module specifier
resolves to a path outside of the base directory, it is rewritten to be relative
to the root directory by prefixing it with the a special root path prefix.
Example:
If you have a monorepo with packages at packages/foo and packages/barfoo
and you want to serve content from the package , you should set the rootpackages/foo
to the monorepo root and base to .
import 'bar' from within the foo package will be rewritten to import
'/__root__/packages/bar/index.js', and the server will serve the file frompackages/bar/index.js`.