to-build is a quick build generator
to-build parses an index.html in development and generates a new build from it.
$> npm install to-build
./out/staging
=> Contains minified files + sourcemaps
./out/production
=> Contains minified files with no sourcemaps (partially flattened folder)
$> to-build src/index.html
Options | Description | Expect | Default |
---|---|---|---|
--development | Only launch the server against your development folder | boolean | |
--staging | Do a build for staging | boolean | |
--production | Do a build for production | boolean | |
--all | Do a build for staging and production at once | boolean | |
--noserver | Do not run servers after builds | boolean | |
--output | The folder to hold the build | string | |
--root | Folders the engine will look up to, to resolve extracted uris including the current working directory and the node_modules folder |
string[] | [ , user defined , <node_modules>] |
--static | Extra Folders the engine will look up to, to resolve extracted uris if not found in the --root ones | string[] | |
--minifyCss | Whether to minify css | boolean | |
--minifyJs | Whether to minify js | boolean | |
--minifyHtml | Whether to minify html | boolean | |
--sourcemaps | Whether to generate sourcemaps | boolean |
- Sourcemaps are not generated in production
By default, the development server runs on port 10000, staging on port 10002 and production on port 10004.
To have a quick report:
$> npx genserve scan --namespace to-build
To edit ports, locate the configuration file with:
# To get the servers configuration path
$> npx genserve path servers --namespace to-build
To stop servers
$> npx genserve stop all --namespace to-build
$> to-build src/index.html --output target
$> to-build src/index.html --sourcemaps false
$> to-build src/index.html --minifyCss false
$> to-build src/index.html --minifyHtml false
$> to-build src/index.html --minifyJs false
$> to-build src/index.html --production
$> to-build src/index.html --staging
$> to-build src/index.html --development