Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vite-pwa
Advanced tools
Readme
This package helps you to cache your files with service worker.
npm i -D vite-pwa
yarn add -D vite-pwa
pnpm add -D vite-pwa
Add vitePwa()
(or whatever you decide to name your default import) to the list of plugins in the ViteJS configuration file (vite.config.js
) of your project.
import { defineConfig } from 'vite'
import vitePwa from 'vite-pwa'
export default defineConfig({
//...
plugins: [/*...*/ vitePwa()],
})
Once you have done that, this will create everything's you need to make a pwa(I mean just Service Worker caching) in production mode
type Options = {
/**
* Name of the worker file that will be generated
*/
swDest: string = 'sw'
/**
* Name of the worker regiester file that will be generated
*/
registerSwDest: string = 'swRegister'
/**
* If enabled file mappings will be generated
*/
map: boolean = false
/**
* Name of the file mappings that will be generated.
* Output: //
* - /mappings.all.json [All the files that are inside the build folder]
* - /mappings.build.json [All the files that is created by vite]
*/
mapDest: string = 'mappings'
/**
* This enables spa(single page application) mode when there is no internet. All the requests will redirected to '/'
*/
spa: boolean = true
/**
* If enabled 'service worker' and 'service worker register' files will be included in the pre-cache
*/
preCacheSw: boolean = true
/**
* manually add files that will be precached
*/
preCacheFiles: [string] = []
/**
* Check which files should be included in the pre cache list
* 'true' -> all
* 'RegExp' -> regex.test(fileName)
* 'function' -> true | false
* Anything else will be ignored
*/
preCacheFilter: true | function | RegExp | any = null
/**
* Cache name for preCached files
*/
preCacheName: string = 'pre-cache'
/**
* Cache name for runtime cached files
*/
runtimeCacheName: string = 'runtime-cache'
}
FAQs
This package helps you to cache your files with service worker.
The npm package vite-pwa receives a total of 15 weekly downloads. As such, vite-pwa popularity was classified as not popular.
We found that vite-pwa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.