UNPKG

717 BJavaScriptView Raw
1/**
2 * Bundl plugin to package 'required' dependencies
3 */
4
5var pack = require('./pack');
6var requirer = require('./pack/requirer');
7var utils = require('seebigs-utils');
8
9function bundlPack (options) {
10 var opts = Object.assign({}, options);
11
12 /**
13 * @param {String} contents the initial contents of the file being processed
14 * @option {Object} r the resource object being processed
15 * @returns { changemap, contents (updated) }
16 */
17 function one (contents, r) {
18 var bundl = this;
19 r = r || { contents: contents, sourcemaps: [] };
20 return pack(bundl, r, opts);
21 }
22
23 return {
24 one: one
25 };
26
27}
28
29bundlPack.requirer = requirer;
30
31module.exports = bundlPack;