Skip to content

Commit

Permalink
eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekbh committed Jul 21, 2017
1 parent 119e464 commit b02ca91
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const SwPrecacheWebpackPlugin = require('sw-precache-webpack-plugin');
const SwPrecacheWebpackPlugin = require('sw-precache-webpack-plugin')

const preactCliPrecachePlugin = (config, swPrecacheOptions) => {
if (!config) {
throw Error('Webpack config not given!');
}
if (!swPrecacheOptions) {
throw Error('swPrecache options not given!');
}
const plugins = config.plugins;
for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
const plugin = plugins[pluginIndex];
if (plugin instanceof SwPrecacheWebpackPlugin){
plugin.options = swPrecacheOptions;
if (!config) {
throw Error('Webpack config not given!')
}
}
return config;
};
if (!swPrecacheOptions) {
throw Error('swPrecache options not given!')
}
const plugins = config.plugins
for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
const plugin = plugins[pluginIndex]
if (plugin instanceof SwPrecacheWebpackPlugin){
plugin.options = swPrecacheOptions
}
}
return config
}

module.exports = preactCliPrecachePlugin;
module.exports = preactCliPrecachePlugin

0 comments on commit b02ca91

Please sign in to comment.