New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nuxtjs/workbox

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuxtjs/workbox - npm Package Compare versions

Comparing version 3.0.0-beta.0 to 3.0.0-beta.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [3.0.0-beta.1](https://github.com/nuxt-community/pwa-module/compare/v3.0.0-beta.0...v3.0.0-beta.1) (2019-02-07)
### Features
* use better regexes ([318228e](https://github.com/nuxt-community/pwa-module/commit/318228e))
# [3.0.0-beta.0](https://github.com/nuxt-community/pwa-module/compare/v2.6.0...v3.0.0-beta.0) (2019-02-04)

@@ -8,0 +19,0 @@

23

lib/options.js
const path = require('path')
const defaults = require('./defaults')
const { fixUrl, isUrl } = require('./utils')
const { joinUrl, getRouteParams } = require('@nuxtjs/pwa-utils')
const HMRRegex = '(?!.*(__webpack_hmr|hot-update))'
function getOptions (moduleOptions) {

@@ -16,11 +18,4 @@ const options = Object.assign({}, defaults, moduleOptions, this.options.workbox)

if (!options.publicPath) {
if (isUrl(this.options.build.publicPath)) {
// CDN
options.publicPath = this.options.build.publicPath
if (options.publicPath.indexOf('//') === 0) {
options.publicPath = '/' + options.publicPath
}
} else {
options.publicPath = fixUrl(`${options.routerBase}/${this.options.build.publicPath}`)
}
const { publicPath } = getRouteParams(this.options)
options.publicPath = publicPath
}

@@ -40,3 +35,3 @@

if (!options.swURL) {
options.swURL = fixUrl(`${options.routerBase}/sw.js`)
options.swURL = joinUrl(options.routerBase, 'sw.js')
}

@@ -46,3 +41,3 @@

if (!options.swScope) {
options.swScope = fixUrl(`${options.routerBase}/`)
options.swScope = options.routerBase
}

@@ -53,3 +48,3 @@

options.runtimeCaching.push({
urlPattern: fixUrl(`${options.publicPath}/(?!.*hot-update).+`),
urlPattern: joinUrl(options.publicPath, HMRRegex),
handler: 'cacheFirst'

@@ -62,3 +57,3 @@ })

options.runtimeCaching.push({
urlPattern: fixUrl(`${options.routerBase}/.*`),
urlPattern: joinUrl(`^${options.routerBase}`, HMRRegex),
handler: 'networkFirst'

@@ -65,0 +60,0 @@ })

const { readFileSync, existsSync } = require('fs')
function fixUrl (url) {
return url.replace(/\/\//g, '/').replace(':/', '://')
}
function isUrl (url) {
return url.indexOf('http') === 0 || url.indexOf('//') === 0
}
function readJSFiles (files) {

@@ -25,5 +18,3 @@ return Array.from(files)

module.exports = {
fixUrl,
isUrl,
readJSFiles
}
{
"name": "@nuxtjs/workbox",
"version": "3.0.0-beta.0",
"version": "3.0.0-beta.1",
"license": "MIT",

@@ -10,3 +10,6 @@ "main": "lib/module.js",

},
"gitHead": "ef541d202ea3d067ce74245300cf58933dbb5bb1"
"dependencies": {
"@nuxtjs/pwa-utils": "3.0.0-beta.1"
},
"gitHead": "9ce84a1ef64b58cecd2637af6dd2b7897cf60c55"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc