0.0.4 • Published 5 years ago

@bundles/bundles-tplit v0.0.4

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

Bundles Tplit Bundler

This is a bundler plugin for Bundles. It uses tplit to compile Bundles input with the power of native JavaScript templating with template literals.

Environment support

NodeCLIES ModuleBrowserUMD
xxx

Install

npm install @bundles/core @bundles/bundles-tplit -D

Usage

See configuring Bundles for how to configure Bundles and bundlers.

Configuration

The following configuration options are available:

  • options {Object} Options passed to tplit.
  • data {Object|Function} Data to compile the template with. This will be merged on top of any existing front matter. An Object is used as is. A Function:
    1. is called on each output file;
    2. returns an Object; and
    3. is passed the file and bundle Objects, for example:
      {
          run: '@bundles/bundles-tplit',
          data: ( file, bundle ) => {
              // return data Object
              return {
                  source: file.source.path,
                  id: bundle.id
              }
          }
      }