1.1.0 • Published 1 year ago

to-build v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

OptionsDescriptionExpectDefault
--developmentOnly launch the server against your development folderboolean
--stagingDo a build for stagingboolean
--productionDo a build for productionboolean
--allDo a build for staging and production at onceboolean
--noserverDo not run servers after buildsboolean
--outputThe folder to hold the buildstring
--rootFolders the engine will look up to, to resolve extracted uris including the current working directory and the node_modules folderstring[], user defined, <node_modules>
--staticExtra Folders the engine will look up to, to resolve extracted uris if not found in the --root onesstring[]
--minifyCssWhether to minify cssboolean
--minifyJsWhether to minify jsboolean
--minifyHtmlWhether to minify htmlboolean
--sourcemapsWhether to generate sourcemapsboolean
  • 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

Changelog

current:
  • Add the directive to-build remove to remove code from generated html files
  • Fix generated html
  • Fix files containing special characters in uris not processed
  • Add one second pause after starting a server
  • Remove duplicated log ids
  • Do not start all builds automatically
  • Use AnaLogger module to display logs
  • Add --noserver option to prevent launching servers automatically
  • Run all servers at start
  • Fix generation for production assets
  • Generate build for production
  • Add --static options to add extras static directories
  • Scan css to add more linked files to the build directory
  • Start server after build
  • Add missing library source-finder
  • Fix build missing resource files
  • Fix build generation for script module types
  • Minify module type js with to-esm
  • Minify HTML
  • Generate css files with options from html
  • Fix missing css files processing
  • Run from CLI

1.1.0

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago