@roots/bud-extensions
Version:
bud.js core module
35 lines (34 loc) • 1.01 kB
JavaScript
import { __decorate } from "tslib";
import { DynamicOption, Extension } from '@roots/bud-framework/extension';
import { bind, label, options, } from '@roots/bud-framework/extension/decorators';
/**
* Webpack profile plugin configuration
*/
let BudProfile = class BudProfile extends Extension {
/**
* {@link Extension.make}
*/
async make(bud, options) {
const { debug } = await this.import(`@roots/bud-support/webpack`, import.meta.url);
return new debug.ProfilingPlugin({ ...options });
}
/**
* {@link Extension.when}
*/
when(bud) {
return bud.context.debug;
}
};
__decorate([
bind
], BudProfile.prototype, "make", null);
__decorate([
bind
], BudProfile.prototype, "when", null);
BudProfile = __decorate([
label(`@roots/bud-extensions/webpack-profile-plugin`),
options({
outputPath: DynamicOption.make((bud) => bud.path(`@storage`, bud.label, `compiler.profile.json`)),
})
], BudProfile);
export default BudProfile;