quasar-cli
Version:
Quasar Framework CLI
17 lines (14 loc) • 403 B
JavaScript
module.exports = class PwaManifest {
constructor (cfg = {}) {
this.manifest = JSON.stringify(cfg.pwa.manifest)
}
apply (compiler) {
compiler.hooks.emit.tapAsync('manifest.json', (compiler, callback) => {
compiler.assets['manifest.json'] = {
source: () => new Buffer(this.manifest),
size: () => Buffer.byteLength(this.manifest)
}
callback()
})
}
}