{"library":"rollup-plugin-workbox-inject","title":"rollup-plugin-workbox-inject","description":"Rollup plugin that injects a Workbox precache manifest into a Rollup-compiled service worker. Currently at version 2.0.0 (last updated 2020), this plugin differs from other Rollup/Workbox plugins by letting Rollup control the entire compilation and output of the service worker, instead of Workbox moving the file and bypassing Rollup. It uses workbox-build's getManifest() method and supports all options from that API, plus a customizable injectionPoint (default: 'self.__WB_MANIFEST'). Requires Rollup ^1.2.0 and Workbox v5+ in the service worker. Not actively maintained.","language":"javascript","status":"maintenance","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-workbox-inject"],"cli":null},"imports":["import workbox from 'rollup-plugin-workbox-inject'","const workbox = require('rollup-plugin-workbox-inject');","self.__WB_MANIFEST"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import workbox from 'rollup-plugin-workbox-inject';\nimport replace from '@rollup/plugin-replace';\n\nexport default {\n  input: 'src/sw.js',\n  output: {\n    dir: 'public',\n    format: 'esm',\n  },\n  plugins: [\n    replace({\n      'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production'),\n    }),\n    workbox({\n      globDirectory: 'public',\n      globPatterns: ['css/**/*.css', 'js/**/*.js'],\n    }),\n  ],\n};","lang":"javascript","description":"Shows how to configure rollup-plugin-workbox-inject in rollup.config.js with @rollup/plugin-replace to set NODE_ENV.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}