mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-22 15:02:11 +08:00
15 lines
351 B
TypeScript
15 lines
351 B
TypeScript
export class StaticAssetPlugin {
|
|
|
|
constructor(private name: string, private contents: string) {}
|
|
|
|
apply(compiler: any): void {
|
|
compiler.plugin('emit', (compilation: any, cb: Function) => {
|
|
compilation.assets[this.name] = {
|
|
size: () => this.contents.length,
|
|
source: () => this.contents,
|
|
};
|
|
cb();
|
|
});
|
|
}
|
|
}
|