vitrify 0.13.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/node/index.ts +7 -4
- package/src/vite/vue/main.ts +7 -3
package/dist/index.js
CHANGED
|
@@ -250,10 +250,10 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
250
250
|
name: 'vitrify-transforms',
|
|
251
251
|
enforce: 'pre',
|
|
252
252
|
transform: (code, id) => {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
if (['main.ts', 'vitrify'].every((val) => id.includes(val))) {
|
|
254
|
+
if (!isPwa)
|
|
255
|
+
code = code.replace(/\/\/ @vitrify-pwa-only((.|\n)*)\/\/ @vitrify-pwa-only-end/, '');
|
|
256
|
+
}
|
|
257
257
|
if (['RootComponent.vue', 'vitrify'].every((val) => id.includes(val))) {
|
|
258
258
|
const css = `${globalCss
|
|
259
259
|
.map((css) => `@import '${css}';`)
|
package/package.json
CHANGED
package/src/node/index.ts
CHANGED
|
@@ -327,10 +327,13 @@ export const baseConfig = async ({
|
|
|
327
327
|
name: 'vitrify-transforms',
|
|
328
328
|
enforce: 'pre',
|
|
329
329
|
transform: (code, id) => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
if (['main.ts', 'vitrify'].every((val) => id.includes(val))) {
|
|
331
|
+
if (!isPwa)
|
|
332
|
+
code = code.replace(
|
|
333
|
+
/\/\/ @vitrify-pwa-only((.|\n)*)\/\/ @vitrify-pwa-only-end/,
|
|
334
|
+
''
|
|
335
|
+
)
|
|
336
|
+
}
|
|
334
337
|
if (['RootComponent.vue', 'vitrify'].every((val) => id.includes(val))) {
|
|
335
338
|
const css = `${globalCss
|
|
336
339
|
.map((css) => `@import '${css}';`)
|
package/src/vite/vue/main.ts
CHANGED
|
@@ -78,10 +78,14 @@ export async function createApp(
|
|
|
78
78
|
await fn({ app, ssrContext, staticImports })
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
// @vitrify-pwa-only
|
|
82
|
+
if (__IS_PWA__) {
|
|
83
|
+
if (typeof window !== 'undefined') {
|
|
84
|
+
const { registerPWA } = await import('./pwa.js')
|
|
85
|
+
registerPWA(router)
|
|
86
|
+
}
|
|
84
87
|
}
|
|
88
|
+
// @vitrify-pwa-only-end
|
|
85
89
|
|
|
86
90
|
return { app, router, routes }
|
|
87
91
|
}
|