initial support for pwa mode
This commit is contained in:
@ -1,9 +1,14 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
|
||||
// import * as mdPlugin from 'vite-plugin-markdown';
|
||||
|
||||
export default defineConfig(({ command, mode, ssrBuild }) => {
|
||||
if (command === "serve") {
|
||||
return {
|
||||
plugins: [
|
||||
VitePWA({ registerType: 'autoUpdate' })
|
||||
],
|
||||
assetsInclude: ["**/*.md"],
|
||||
server: {
|
||||
port: 8000,
|
||||
@ -12,6 +17,9 @@ export default defineConfig(({ command, mode, ssrBuild }) => {
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
plugins: [
|
||||
VitePWA({ registerType: 'autoUpdate' })
|
||||
],
|
||||
chunkSizeWarningLimit: 1600 * 2,
|
||||
build: {
|
||||
outDir: "dist",
|
||||
|
||||
Reference in New Issue
Block a user