@devserver/package-exports v0.15.8
@devserver/cli
Minimalist development server with minimal disk impact and designed for modern development.
Dev support
- Support for JSX(pragma and jsx-runtime) and TS tanks to Sucrace.
- Livereload, HTTP2 with automatic SSL.
- Resolution from NPM only if the package has support for modules declared by
package.json#exports
orpackage.json#module
. - Alternative NPM package resolution via CDN.
Build support
- Support for JSX(pragma and jsx-runtime) and TS tanks to Sucrace.
- Assets hash.
- CSS and JS optimization.
- Resolution from NPM only if the package has support for modules declared by
package.json#exports
orpackage.json#module
. - Automatic detection of external dependencies.
- Alternative NPM package resolution via CDN.
Considerations
- All import requires the use of extension, example
./my.js
. - All relative resources require the use of the
./
or../
pattern.
Dev mode
This mode is designed to serve content from an HTML file and process the content served on demand according to the type.
npx devserver dev <src>
## Directory example
src
├──index.js
└──index.html
## Script
npx devserver dev src
Build mode flag
--port [port]
: Modify the default port 80
.
--spa [file]
: The unresolved requests are redirected to the file to associate.
--jsxImportSource [jsxImportSource]
: allows to associate the package to use for jsx-runtime.
--ssl
: enables the use of HTTP2 with SSL.
--cdn
: Resolve NPM packages from a CDN.
Build mode
This mode packages the site or application according to the export pattern, example:
npx devserver build <src> <dest>
## Example
npx devserver build src/*.html public
The previous example will export all the asset files that are related to the files captured by the expression.
Build mode flag
--jsxImportSource [jsxImportSource]
: allows to associate the package to use for jsx-runtime.
--cdn
: Resolve NPM packages from a CDN.
--minify
: Minify JS and CSS code.
--href [href]
: Associate a prefix for file resolution.
--external [external]
: Associate external dependencies manually.
Build rule
- The path must always start from a static folder, example:
src/** ## `src` is the static path
src/site-1/** ## `src/site-1` is the static path
- All relative import requires the use of extension.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago