Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 29, 2020 06:19
Embed
What would you like to do?
const WorkboxWebpackPlugin = require("workbox-webpack-plugin");
module.exports = function override(config, env) {
config.plugins = config.plugins.map((plugin) => {
if (plugin.constructor.name === "GenerateSW") {
return new WorkboxWebpackPlugin.InjectManifest({
swSrc: "./src/service-worker-custom.js",
swDest: "service-worker.js"
});
}
return plugin;
});
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment