nuxt-web-update-notification

0.1.0 • Public • Published

nuxt-web-update-notification npm

Detect webpage updates and notify user to reload. support Nuxt.

Install

# use yarn (recommend)
yarn add -D nuxt-web-update-notification
# or use npm
npm install --save-dev nuxt-web-update-notification

Example

// nuxt.config.js
export default {
  mode: 'universal',
  env: {
    PATH_TYPE: process.env.PATH_TYPE,
  },
  /*
   ** Nuxt.js modules
   */
  modules: [
    [
      'nuxt-web-update-notification',
      {
        logVersion: true,
        checkInterval: 5 * 60 * 1000, // 5 分钟设置轮询一次
        // 在某些环境下才开启该 Module
        shouldBeEnable: (options) => {
          if (options.env.PATH_TYPE === 'trial') {
            return true;
          }
          return false;
        },
      },
    ],
  ],
};

Thanks

Package Sidebar

Install

npm i nuxt-web-update-notification

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

14.2 kB

Total Files

5

Last publish

Collaborators

  • yanyue404