0.0.4 • Published 5 years ago
@bundles/bundles-tplit v0.0.4
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
Node | CLI | ES Module | Browser | UMD |
---|---|---|---|---|
✓ | ✓ | x | x | x |
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:- is called on each output file;
- returns an Object; and
- is passed the
file
andbundle
Objects, for example:{ run: '@bundles/bundles-tplit', data: ( file, bundle ) => { // return data Object return { source: file.source.path, id: bundle.id } } }