Skip to content

Commit

Permalink
Fix failing tests from pr #38
Browse files Browse the repository at this point in the history
  • Loading branch information
goldhand committed Jan 9, 2017
1 parent 8c407cb commit 6c587bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -14,7 +14,7 @@ const
const DEFAULT_OPTIONS = {
cacheId: DEFAULT_CACHE_ID,
filename: DEFAULT_WORKER_FILENAME,
forceDelete: true
forceDelete: false,
};

/**
Expand Down Expand Up @@ -42,6 +42,7 @@ const DEFAULT_OPTIONS = {
* @param {string} [options.filename] - Service worker filename, default is 'service-worker.js'
* @param {string} [options.filepath] - Service worker path and name, default is to use webpack.output.path + options.filename
* @param {RegExp} [options.staticFileGlobsIgnorePatterns[]] - Define an optional array of regex patterns to filter out of staticFileGlobs
* @param {boolean} [options.forceDelete=false] - pass force option to del
*/
class SWPrecacheWebpackPlugin {

Expand Down Expand Up @@ -117,7 +118,7 @@ class SWPrecacheWebpackPlugin {
...this.overrides,
};

return del(filepath, { ...this.options.forceDelete }).then(() => {
return del(filepath, {force: this.options.forceDelete}).then(() => {
return swPrecache.write(filepath, workerOptions);
});
}
Expand Down
1 change: 1 addition & 0 deletions test/plugin.spec.js
Expand Up @@ -12,6 +12,7 @@ import fs from 'fs';
const DEFAULT_OPTIONS = {
cacheId: 'sw-precache-webpack-plugin',
filename: 'service-worker.js',
forceDelete: false,
};

const webpackConfig = () => {
Expand Down

0 comments on commit 6c587bb

Please sign in to comment.