
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@cdjs/pwa-webpack-plugin
Advanced tools
渐进式 Web 引用(PWA) 相关概念......
此插件目前主要实现如下功能:
Cache StorageService Worker ,添加基本的资源缓存控制逻辑yarn add @cdjs/pwa-webpack-plugin -D
// or
npm install @cdjs/pwa-webpack-plugin --save-dev
// webpack.config.js
const PWAWebpackPlugin = require('@cdjs/pwa-webpack-plugin')
plugins: [
...new PWAWebpackPlugin({
...options,
}),
]
serviceWorkerFilename: stringrequire: false | default: 'sw.js'
Service Worker 注册脚本文件名.
manifestFilename: stringrequire: false | default: 'manifest.webmanifest'
网页应用清单文件名.
manifestIconDir: stringrequire: false | default: 'manifest-icon'
网页应用清单 icon 文件路径
cacheStorageName: stringrequire: false | default: 'runtime-storage'
Cache Storage 库名
noStaticAssets: string[]require: false | default: ['index.html']
项目中非静态类型的资源。
Vue SPA 为例:正常打包完都会将静态资源上传至 Webpack 配置的 publicPath 指向的地址,而将入口文件(一般为 index.html ) 存在服务器,并配置 Cache-Control: no-cache。此时,就需要将 index.html 传入该数组,因为在打开网页时,index.html 是不同于其他静态资源的加载方式。
noCache: string[]require: false
不需要缓存的文件列表,打包后的文件
skipWaiting: booleanrequire: false | default: true
是否通过 skipWaiting 跳过 waiting 状态,官方文档
manifest: objectrequire: true
应用清单文件,具体参数如下:
name: string
require: true
网站应用全称,用于应用安装提示及启动页面的显示。
short_name: string
require: true
网站应用名简写,用于添加到主屏幕时的应用名展示,不要超过 12 个字符。
start_url: string
require: false | default: '/'
定义添加到桌面后的启动 URL。
background_color: string
require: false | default: '#FFF'
网站背景色,在启动页面时显示
theme_color: string
require: false | default: '#f4f4f4'
网站主题色,定义浏览器 UI 的主题色
display: 'fullscreen' | 'standalone' | 'browser' | 'minimal-ui'
require: false | default: 'fullscreen'
显示模式,官方文档
icons: object | object[]
应用图标,支持依据指定图标生成不同尺寸格式的图标,格式如下:
// 复制已存在的 icon 列表
icons: [
src: '', // 路径
type: '', // 文件类型,MIME 格式
sizes: '', // 支持的格式列表,若是 .ico 这种支持多格式的文件,传入 '72x72 96x96 128x128 ... ...'
]
// 生成指定格式的 icon
icons: [
src: '', // 路径
type: '', // 文件类型,MIME 格式
targetSizes: [ // 指定要生成的尺寸
'96x96',
'128x128',
'512x512'
],
]
FAQs
Progressive Web App's webpack plugin
The npm package @cdjs/pwa-webpack-plugin receives a total of 1 weekly downloads. As such, @cdjs/pwa-webpack-plugin popularity was classified as not popular.
We found that @cdjs/pwa-webpack-plugin 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.