vite-pwa / vitepress Goto Github PK
View Code? Open in Web Editor NEWZero-config PWA Plugin for VitePress
Home Page: https://vite-pwa-org.netlify.app/frameworks/vitepress
License: MIT License
Zero-config PWA Plugin for VitePress
Home Page: https://vite-pwa-org.netlify.app/frameworks/vitepress
License: MIT License
and remove local copy with the transformHead
PR
import type { Plugin,UserConfig } from 'vitepress'
import { generateSidebar } from './sidebar';
import defineConfig from '../config';
export const FileHMR = (): Plugin => {
return {
name: 'vite-file-hmr',
configureServer({
watcher,
restart
}) {
const fsWatcher = watcher.add('*.md');
fsWatcher.on('all', async (event: string, path: string) => {
if (event !== 'change') {
try {
(defineConfig as UserConfig).themeConfig.sidebar = generateSidebar()
await restart();
} catch (error: any){
console.log("π ", (defineConfig as UserConfig).themeConfig)
console.log(error)
}
}
});
},
}
}
generatesidebar()
is used to automatically generate the configuration structure of sidebar
, so sidebar
will not be updated automatically when vite changes the file, so I use the above code for hot update, but I can't get sidebar
after wrapping defineConfig
withPwa
.
we should also add gh funding and actions
the hero image should be for VitePress, like the title: Zero-config PWA Plugin for VitePress
@antfu do you like that change? If so, can you change/provide the hero image?
extract index module logic to vitepress module
pnpm install -D @vite-pwa/vitepress
βWARNβ Issues with peer dependencies found
.
βββ¬ @vite-pwa/vitepress 0.0.5
βββ β unmet peer vite-plugin-pwa@^0.14.0: found 0.15.1
We need:
injectRegister
to be 'virtual' | 'script' | 'inline'
: defaults to script
?registerSW.js
or inline
code to register the sw when injectRegister !== 'virtual'
(if using virtual, just ignore it)not working in pwa-prompt example, there is no client build!
EDIT: we should check if adding a custom plugin removing the ssr check (on pwa build plugin) works (it should work: we're getting the api reference using mpa flag)
Get Started
So do Vue Macros, VueUse
When I add some url params such as ?a=1&b=2
after the page's URL, the console log an error Hydration completed but contains mismatches.
and the page rendering is incorrect
https://github.com/GlobeMC/crashmc.com
pnpm install && pnpm run docs:build && pnpm run docs:preview
OR
Just access https://vite-pwa-org.netlify.app/guide/register-service-worker.html?
The two pages should looks exactly same.
Some information at vuejs/vitepress#3469
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.