poi-plugin-offline

Add offline support to your app.

Usage no npm install needed!

<script type="module">
  import poiPluginOffline from 'https://cdn.skypack.dev/poi-plugin-offline';
</script>

README

poi-plugin-offline

Add offline support to your app.

Install

yarn add offline-plugin
yarn add poi-plugin-offline --dev

Usage

// poi.config.js
module.exports = {
  plugins: [
    require('poi-plugin-offline')(options)
  ]
}

API

Table of Contents

offlinePlugin

Add offline support to your app

Parameters

  • options Object
    • options.entry String Specific the entry to add offline-plugin runtime file. (optional, default 'client')
    • options.pwa string Path to your offline-plugin runtime file.See ./pwa.js for built-in runtime entry. (optional, default path.join(__dirname,'pwa.js'))
    • options.pluginOptions Object Options for offline-plugin.See offline-plugin docs for details. (optional, default { ServiceWorker:{ events:true, navigateFallbackURL:'/' }, AppCache:{ events:true, FALLBACK:{'/':'/'} } })

Examples

require('poi-plugin-offline')({
  pwa: './src/pwa.js' // Use your own runtime, relative to $cwd
})

License

MIT © EGOIST