liveBook · Manning

Deployment pipeline

As explained in Web Components in Action

A build step is an automated processing stage that transforms or prepares source code and assets for development or production.

A build step transforms code or assets between editing and browser delivery. It can compile CSS, assemble HTML snippets, transpile code to JavaScript, or bundle modules, so the browser may not run the files as written. section 12.3 section 12.4

A lightweight way to run build tasks is through npm scripts in package.json:

  • Install tools such as Rollup as development dependencies. section 12.4
  • Add scripts to build individual components, then chain those scripts to run several builds. section 12.4
  • Choose tools to suit the task; build systems can overlap, and simpler workflows may be enough. section 12.3
Listing 12.9. Adding a Rollup script in package.json
{
 "name": "wcia",
 "version": "1.0.0",
 "dependencies": {},
 "devDependencies": {
   "rollup": "^1.0.2"
 },
 "scripts": {
 "build": "./node_modules/.bin/rollup chapter12and13/components/slider/src/#1
   slider.js --file chapter12and13/components/slider/slider.js --format    #1
   umd --name slider -m"                                                   #1
}

A package.json script runs Rollup on a component’s source file and writes a bundled output file. section 12.4

Building a component

A slider component can be bundled from its source file into a UMD output; a source map can help connect errors in that output to the source files. section 12.4

How Web Components in Action covers it

How deep it goes
Explains npm scripts and Rollup component bundling, including output paths and chained builds, while leaving tool choice open.
Examples
Uses Sass and LESS compilation, HTML assembly, TypeScript transpilation, and Rollup bundles for component files.
What it assumes
Starts with npm package installation and package.json scripts, without requiring a complex build-system workflow.
What you can do after
Operate/configure npm scripts to run Rollup builds for individual components or chain several component builds.
How it connects
Connects build steps with npm, Node.js, transpilation, bundling, and tools such as Rollup, Webpack, Grunt, and Gulp.

Also explained in

Compare how 30 books explain deployment pipeline →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Components in Action. The section links point to the parts of the book it draws on.