Created
June 11, 2020 14:18
-
-
Save benjaminrichardson-ms/1c6af6098ddda67591e42765266c1bea to your computer and use it in GitHub Desktop.
// source https://jsbin.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
// CODE FROM node_modules/@nuxtjs/onesignal/index.js | |
// Adjust manifest for oneSignal | |
if (!this.options.manifest) { | |
this.options.manifest = {} | |
} | |
this.options.manifest.gcm_sender_id = options.GcmSenderId | |
// Adjust swURL option of Workbox for oneSignal | |
if (!this.options.workbox) { | |
this.options.workbox = {} | |
} | |
this.options.workbox.swURL = 'OneSignalSDKWorker.js' | |
console.log('@nuxtjs/onesignal: this.options.workbox.swURL has been set') | |
// CODE FROM node_modules/@nuxtjs/pwa/lib/module.js | |
// Shared options context | |
this.options.pwa = { ...(this.options.pwa || {}), ...(moduleOptions || {}) } | |
const { pwa } = this.options | |
// Normalize options | |
for (const name of modules) { | |
// Skip disabled modules | |
if (pwa[name] === false) { | |
continue | |
} | |
// Ensure options are an object | |
if (pwa[name] === undefined) { | |
pwa[name] = {} | |
} | |
// Backward compatibility for top-level options | |
if (this.options[name] !== undefined) { | |
pwa[name] = { ...this.options[name], ...pwa[name] } | |
} | |
} | |
console.log('@nuxtjs/pwa: All this.options have been set in pwa object') | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">// CODE FROM node_modules/@nuxtjs/onesignal/index.js | |
// Adjust manifest for oneSignal | |
if (!this.options.manifest) { | |
this.options.manifest = {} | |
} | |
this.options.manifest.gcm_sender_id = options.GcmSenderId | |
// Adjust swURL option of Workbox for oneSignal | |
if (!this.options.workbox) { | |
this.options.workbox = {} | |
} | |
this.options.workbox.swURL = 'OneSignalSDKWorker.js' | |
console.log('@nuxtjs/onesignal: this.options.workbox.swURL has been set') | |
// CODE FROM node_modules/@nuxtjs/pwa/lib/module.js | |
// Shared options context | |
this.options.pwa = { ...(this.options.pwa || {}), ...(moduleOptions || {}) } | |
const { pwa } = this.options | |
// Normalize options | |
for (const name of modules) { | |
// Skip disabled modules | |
if (pwa[name] === false) { | |
continue | |
} | |
// Ensure options are an object | |
if (pwa[name] === undefined) { | |
pwa[name] = {} | |
} | |
// Backward compatibility for top-level options | |
if (this.options[name] !== undefined) { | |
pwa[name] = { ...this.options[name], ...pwa[name] } | |
} | |
} | |
console.log('@nuxtjs/pwa: All this.options have been set in pwa object')</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CODE FROM node_modules/@nuxtjs/onesignal/index.js | |
// Adjust manifest for oneSignal | |
if (!this.options.manifest) { | |
this.options.manifest = {} | |
} | |
this.options.manifest.gcm_sender_id = options.GcmSenderId | |
// Adjust swURL option of Workbox for oneSignal | |
if (!this.options.workbox) { | |
this.options.workbox = {} | |
} | |
this.options.workbox.swURL = 'OneSignalSDKWorker.js' | |
console.log('@nuxtjs/onesignal: this.options.workbox.swURL has been set') | |
// CODE FROM node_modules/@nuxtjs/pwa/lib/module.js | |
// Shared options context | |
this.options.pwa = { ...(this.options.pwa || {}), ...(moduleOptions || {}) } | |
const { pwa } = this.options | |
// Normalize options | |
for (const name of modules) { | |
// Skip disabled modules | |
if (pwa[name] === false) { | |
continue | |
} | |
// Ensure options are an object | |
if (pwa[name] === undefined) { | |
pwa[name] = {} | |
} | |
// Backward compatibility for top-level options | |
if (this.options[name] !== undefined) { | |
pwa[name] = { ...this.options[name], ...pwa[name] } | |
} | |
} | |
console.log('@nuxtjs/pwa: All this.options have been set in pwa object') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment