fuse-box
Version:
Fuse-Box a bundler that does it right
25 lines (23 loc) • 694 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class ReplacePluginClass {
constructor(options = {}) {
this.options = options;
this.test = /.*/;
}
;
transform(file) {
file.loadContents();
for (let key in this.options) {
if (this.options.hasOwnProperty(key)) {
const regexp = new RegExp(key, 'g');
file.contents = file.contents.replace(regexp, this.options[key]);
}
}
}
}
exports.ReplacePluginClass = ReplacePluginClass;
exports.ReplacePlugin = (options) => {
return new ReplacePluginClass(options);
};
//# sourceMappingURL=ReplacePlugin.js.map