0.2.1 • Published 5 years ago

@bundles/bundles-output v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Bundles Output Bundler

This is a bundler plugin for use with Bundles. bundles-output outputs the data and content compiled by Bundles to disk.

Environment support

NodeCLIES ModuleBrowserUMD
xx

Install

Make sure Bundles core is installed.

npm install @bundles/bundles-output -D

Usage

See configuring Bundles for details on configuring Bundles.

Configuration

IMPORTANT: Unless you know what you're doing, bundles-output should be the last bundler in the config.bundlers Array, since it should typically run after all other bundlers have run.

The following properties are available in bundler.options:

  • to {String|Function} (required) Directory to output compiled data to. Can be a callback Function which returns a String. If return value is falsy, or is not a String, the file will not be output.
  • root {String} (process.cwd()) Root directory for source input paths. For example, settings of { to: 'output', root: 'my/dir' } with a source input of ['my/dir/one.md', 'my/dir/subdir/two.md'] will output files to output/one.md and output/subdir/two.md.
  • incremental {Boolean} true When watching files, whether to utilize the incremental build feature (true) or always output all files (false).
  • fs Options passed to fs-extra's outputFile method, which are the same options passed to node fs's writeFile method. This, for example, gives user control over whether existing files are overwritten. Note: The encoding option is automatically set based on whether the file type is text/utf8 or binary.

Example

// Outputs `src/my/file.md` to `my/dir/my/file.md`.
const bundle = {
  input: 'src/my/file.md',
  bundlers: [
    {
      run: '@bundles/bundles-output',
      options: {
        to: 'my/dir',
        root: 'src',
        incremental: true,
      },
    },
  ],
};
0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago