UNPKG

661 BJavaScriptView Raw
1/**
2 * CarteBlanche Webpack Plugin
3 *
4 * The plugin is instantiated and the emitted carte-blanche.html file is
5 * generated here.
6 */
7
8import apply from './src/apply';
9import validateOptions from './src/validateOptions';
10
11/**
12 * Instantiates the plugin
13 *
14 * @param {Object} options The options
15 */
16let id = -1;
17function CarteBlanche(options) {
18 // Allow for multiple instances of the plugin
19 this.id = (++id);
20 // Default and validate the options
21 validateOptions(options || {});
22 this.options = options;
23}
24
25// This method is the meat of our plugin, it does most of the work
26CarteBlanche.prototype.apply = apply;
27
28module.exports = CarteBlanche;