Static server plugin for egg, base on koa-static-cache
$ npm i egg-sw --save
// {app_root}/config/plugin.js
exports.sw = {
enable: true,
package: 'egg-sw',
};
// {app_root}/config/config.default.js
exports.sw = {
prefix: '/',
path: '/service-worker.js',
dir: path.join(appInfo.baseDir, 'app/public'),
preload: false,
buffer: false,
maxFiles: 1,
dynamic: true,
};
see config/config.default.js for more detail.
Please open an issue here.