workbox-webpack-plugin
Advanced tools
Comparing version 1.3.0 to 2.0.0
const swBuild = require('workbox-build'); | ||
const path = require('path'); | ||
const url = require('url'); | ||
/** | ||
@@ -65,2 +65,26 @@ * Use the instance of this in the plugins array of the webpack config. | ||
if (compilation.options.output.publicPath) { | ||
const {publicPath} = compilation.options.output; | ||
const compiledAssets = []; | ||
for (let key in compilation.assets) { | ||
if (Object.prototype.hasOwnProperty.call(compilation.assets, key)) { | ||
compiledAssets.push(url.resolve(publicPath, key)); | ||
} | ||
} | ||
const publicPathTransform = (manifestEntries) => | ||
manifestEntries.map((entry) => { | ||
if (compilation.assets[entry.url]) { | ||
entry.url = url.resolve(publicPath, entry.url); | ||
} | ||
return entry; | ||
}); | ||
if (Array.isArray(config.manifestTransforms)) { | ||
config.manifestTransforms.unshift(publicPathTransform); | ||
} else { | ||
config.manifestTransforms = [publicPathTransform]; | ||
} | ||
} | ||
return config; | ||
@@ -67,0 +91,0 @@ } |
{ | ||
"name": "workbox-webpack-plugin", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "A plugin for your Webpack build process, helping you generate a manifest of local files that workbox-sw should precache.", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"dependencies": { | ||
"workbox-build": "^1.3.0" | ||
"workbox-build": "^2.0.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "author": "Google's Web DevRel Team", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18051
121
+ Addedworkbox-build@2.1.3(transitive)
+ Addedworkbox-sw@2.1.3(transitive)
- Removedworkbox-build@1.3.0(transitive)
- Removedworkbox-sw@1.3.0(transitive)
Updatedworkbox-build@^2.0.0