Gathering detailed insights and metrics for @pwaset/astro
Gathering detailed insights and metrics for @pwaset/astro
Gathering detailed insights and metrics for @pwaset/astro
Gathering detailed insights and metrics for @pwaset/astro
npm install @pwaset/astro
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Effortlessly empower your Astro project with PWA capabilities.
This package is compatible with
astro@4.0.0
and above and only supports the latest Integrations API.
1$ npm install @pwaset/astro
Step1: Complete the required configuration with the help of JSDoc. and Make sure // @ts-check
is turned on in astro.config.mjs
.
1// @ts-check 2import { defineConfig } from 'astro/config'; 3import pwaset from '@pwaset/astro'; 4 5export default defineConfig({ 6 integrations: [ 7 pwaset({ 8 name: "PWAs: Progressive Web Applications", 9 }) 10 ] 11})
Step2: Then provide at least one source image to the src/pwa
directory, default src/pwa/favicon.svg
.
Step3: npm run build
generates PWA assets in publicDir
Core interfaces: input
, themes
, manifest
, icons
, shourtcuts
, screenshots
. For details, see JSDoc or documentation.
The manifest is currently compatible with w3.org's manifest and some MS Edge manifests. If you need to extend it, please file an issue to
@pwas/core
to get the latest manifest type definition.
1// @ts-check 2import { defineConfig } from 'astro/config'; 3import pwaset from '@pwaset/astro'; 4import { readFile } from 'fs/promises'; 5 6// https://astro.build/config 7export default defineConfig({ 8 integrations: [ 9 pwaset({ 10 // input: ["src/pwa/favicon.svg", await readFile("src/pwa/logo.png")], 11 input: { 12 favicons: ["src/pwa/favicon.svg", await readFile("src/pwa/logo.png")], 13 pwaIcon: ["src/pwa/logo.png", "src/pwa/logo.svg"], 14 yandex: "src/pwa/shortcuts/icon-compose.png", 15 }, 16 // 17 name: "Twitter", 18 themes: ["#fff", "#fff"], 19 background: "#000", 20 appleStatusBarStyle: "black-translucent", 21 manifest: { 22 name_localized: { 23 "zh-CN": { value: "推特", dir: "auto", lang: 'zh-CN' }, 24 en: "Twitter" 25 }, 26 short_name: "x", 27 short_name_localized: { 28 "zh-CN": "推特", 29 en: "x" 30 }, 31 description: "Get breaking news, politics, trending music, world events, sports scores, and the latest global news stories as they unfold - all with less data.", 32 description_localized: { 33 "zh-CN": "获取突发新闻、政治、流行音乐、世界事件、体育比分以及最新的全球新闻报道 - 只需更少的数据。" 34 }, 35 categories: ["beauty", "lifestyle", "fashion"], 36 start_url: "/?utm_source=homescreen&utm_medium=shortcut", 37 display_override: ["window-controls-overlay", "browser"], 38 prefer_related_applications: true, 39 related_applications: [ 40 { 41 platform: "play", 42 url: "https://play.google.com/store/apps/details?id=com.example.app12", 43 id: "com.example.app1", 44 }, 45 { 46 platform: "itunes", 47 url: "https://itunes.apple.com/app/example-app1/id123456789", 48 }, 49 ] 50 }, 51 icons: { 52 favicons: true, 53 pwaIcon: true, 54 appleIcon: true, 55 appleStartup: true, 56 windowsTile: true, 57 yandex: true, 58 }, 59 shortcuts: [ 60 { 61 name: "New post", 62 url: "/compose/post?utm_source=jumplist&utm_medium=shortcut", 63 icon: "src/pwa/shortcuts/icon-compose.png", 64 } 65 ], 66 screenshots: [ 67 { 68 src: "src/pwa/screenshots/wide_2200x1650.png", 69 sizes: "1100x825", 70 form_factor: "wide", 71 platform: "webapp", 72 label: "Wide test" 73 }, 74 { 75 src: "src/pwa/screenshots/iphone_pro_max_narrow.png", 76 form_factor: "narrow", 77 platform: "ios", 78 label: "Norow test" 79 } 80 ], 81 manifestMaskable: true, 82 loadManifestWithCredentials: true, 83 cacheBustingQueryParam: 'v=1.0.0', 84 output: { 85 images: true, 86 files: true, 87 assetsPrefix: "https://www.example.com/assets/images" 88 }, 89 version: "1.0.0" 90 }) 91 ] 92});
Submit your issues or feedback on our GitHub channel.
MIT
No vulnerabilities found.
No security vulnerabilities found.