Skip to content

Latest commit

 

History

History
67 lines (39 loc) · 2.12 KB

build.md

File metadata and controls

67 lines (39 loc) · 2.12 KB

benmvp build Documentation

Builds the library into the desired module formats at the specified location.

Looking for Node API docs? View companion build() documentation.

Examples

Build module formats in default output directory:

benmvp build

To specify an alternate output directory:

benmvp build --out ./built

NOTE: You will need to manually update the default "main", "module", "jsnext:main", "browser", and "types" properties in your package.json to reflect the new location of the built module formats.

To exclude type definitions:

benmvp build --formats esm cjs

To put ESM & type declarations in an alternate build location with continuous watch:

benmvp build --formats esm type --out ./built --watch

Arguments

--formats

A space-separated list of the module formats to build. Aliased as -f. Available formats:

  • type - Typescript definition files (.d.ts) so that clients of your library can use your library fully-typed
  • esm - ECMAScript module format (everything transpiled to ES5 except for ES2015 import/export statements enabling tree shaking)
  • cjs - CommonJS format (fully transpiled)

Optional. Defaults to all formats.

--out

A path (relative or absolute) to the output directory for the built module formats. Aliased as -o.

If you chose 'esm' as one of the formats and choose './built' as the output directory, the ESM files will live at ./built/esm.

Optional. Defaults to ./lib.

--watch

A flag indicating whether or not to continuously generate the built module formats whenever source files change. This is most useful if you've linked your library into a host application (with npm link or yarn link). Aliased as -w.

Optional. Defaults to false.


More help

Looking for Node API docs? View companion build() documentation.

Still unsure of how to use @benmvp/cli? Ask for help!