chore: explicitly use development flag
parent
01ecdcb663
commit
51eaa99441
|
@ -1,12 +1,12 @@
|
||||||
import { isCI } from 'std-env'
|
import { isCI, isDevelopment } from 'std-env'
|
||||||
import type { VitePWANuxtOptions } from '../modules/pwa/types'
|
import type { VitePWANuxtOptions } from '../modules/pwa/types'
|
||||||
|
|
||||||
const isPreview = process.env.PULL_REQUEST === 'true'
|
const isPreview = process.env.PULL_REQUEST === 'true'
|
||||||
|
|
||||||
const pwa: VitePWANuxtOptions = {
|
const pwa: VitePWANuxtOptions = {
|
||||||
mode: isCI ? 'production' : 'development',
|
mode: isCI ? 'production' : 'development',
|
||||||
// disabled PWA only on production
|
// disable PWA only in development
|
||||||
disable: !isCI && process.env.VITE_DEV_PWA !== 'true',
|
disable: isDevelopment && process.env.VITE_DEV_PWA !== 'true',
|
||||||
scope: '/',
|
scope: '/',
|
||||||
srcDir: './service-worker',
|
srcDir: './service-worker',
|
||||||
filename: 'sw.ts',
|
filename: 'sw.ts',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import Inspect from 'vite-plugin-inspect'
|
import Inspect from 'vite-plugin-inspect'
|
||||||
import { isCI } from 'std-env'
|
import { isCI, isDevelopment } from 'std-env'
|
||||||
import { i18n } from './config/i18n'
|
import { i18n } from './config/i18n'
|
||||||
import { pwa } from './config/pwa'
|
import { pwa } from './config/pwa'
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
public: {
|
public: {
|
||||||
env: isCI ? isPreview ? 'staging' : 'production' : 'local',
|
env: isCI ? isPreview ? 'staging' : 'production' : 'local',
|
||||||
pwaEnabled: isCI || process.env.VITE_DEV_PWA === 'true',
|
pwaEnabled: !isDevelopment || process.env.VITE_DEV_PWA === 'true',
|
||||||
translateApi: '',
|
translateApi: '',
|
||||||
// Masto uses Mastodon version checks to see what features are enabled.
|
// Masto uses Mastodon version checks to see what features are enabled.
|
||||||
// Mastodon alternatives like GoToSocial will always fail these checks, so
|
// Mastodon alternatives like GoToSocial will always fail these checks, so
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
"homepage": "https://elk.zone/",
|
"homepage": "https://elk.zone/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxi build",
|
"build": "nuxi build",
|
||||||
"build:pwa": "VITE_DEV_PWA=true nuxi build",
|
|
||||||
"build:netlify:pwa": "VITE_DEV_PWA=true NITRO_PRESET=netlify nuxi build",
|
|
||||||
"dev": "nuxi dev --port 5314",
|
"dev": "nuxi dev --port 5314",
|
||||||
"dev:pwa": "VITE_DEV_PWA=true nuxi dev --port 5314",
|
"dev:pwa": "VITE_DEV_PWA=true nuxi dev --port 5314",
|
||||||
"dev:mocked": "nuxi dev --port 5314 --dotenv .env.mock",
|
"dev:mocked": "nuxi dev --port 5314 --dotenv .env.mock",
|
||||||
|
|
Loading…
Reference in New Issue