NekR / offline-plugin

Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
MIT License
4.52k stars 295 forks source link

why call the "install" function in "offline-plugin/runtime", but the function is "exports.install = function() {};"?? #399

Closed daffy6537 closed 6 years ago

daffy6537 commented 6 years ago

HERE is code in offline-plugin/runtime.js:

the export function install is noop!

var warn = "offline-plugin: runtime was installed without OfflinePlugin being added to the webpack.config.js. See https://goo.gl/2Ca7NO for details.";

if (window.console) { if (console.info) { console.info(warn); } else if (console.log) { console.log(warn); } }

exports.install = function() {}; exports.applyUpdate = function() {}; exports.update = function() {};

NekR commented 6 years ago

It's being dynamically replaced with actual implementation when you add plugin's instance to your config.