1 | /**
|
2 | * Bundl plugin to package 'required' dependencies
|
3 | */
|
4 |
|
5 | var pack = require('./pack');
|
6 | var requirer = require('./pack/requirer');
|
7 | var utils = require('seebigs-utils');
|
8 |
|
9 | function 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 |
|
29 | bundlPack.requirer = requirer;
|
30 |
|
31 | module.exports = bundlPack;
|