Skip to content

thimpat/to-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Name

to-build is a quick build generator


Description

to-build parses an index.html in development and generates a new build from it.


Installation

$> npm install to-build

Usage

Generate builds in the ./out directory with .css and .js minified
Two builds were generated in two different folders:

./out/staging => Contains minified files + sourcemaps

./out/production => Contains minified files with no sourcemaps (partially flattened folder)

$> to-build src/index.html

Options

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

Servers

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

Examples

Generate build in a folder called "target"
$> to-build src/index.html --output target

Generate build with no source map
$> to-build src/index.html --sourcemaps false

Generate build with non-minified css
$> to-build src/index.html --minifyCss false

Generate build with non-minified html
$> to-build src/index.html --minifyHtml false

Generate build with non-minified js
$> to-build src/index.html --minifyJs false

Generate build only for production
$> to-build src/index.html --production

Generate build only for staging
$> to-build src/index.html --staging

Generate build only for development
$> to-build src/index.html --development

About

Utility to generate builds

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published