vitrify 0.7.2 → 0.8.0

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 CHANGED
@@ -10,6 +10,7 @@ import builtinModules from 'builtin-modules';
10
10
  // import { resolve } from 'import-meta-resolve'
11
11
  import { visualizer } from 'rollup-plugin-visualizer';
12
12
  import { resolve } from './app-urls.js';
13
+ import envPlugin from '@vitrify/plugin-env';
13
14
  const internalServerModules = [
14
15
  'util',
15
16
  'vitrify',
@@ -196,6 +197,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
196
197
  ];
197
198
  const plugins = [
198
199
  vuePlugin(),
200
+ envPlugin(),
199
201
  ...frameworkPlugins,
200
202
  {
201
203
  name: 'vitrify-setup',
@@ -38,12 +38,12 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
38
38
  name: 'vite-plugin-quasar-transform',
39
39
  enforce: 'pre',
40
40
  transform: (code, id, options) => {
41
- const { ssr: transformSsr } = options || {};
41
+ const { ssr } = options || {};
42
42
  code = code
43
43
  .replaceAll('__QUASAR_SSR__', ssr ? 'true' : 'false')
44
- .replaceAll('__QUASAR_SSR_SERVER__', ssr === 'server' ? 'import.meta.env.SSR' : 'false')
45
- .replaceAll('__QUASAR_SSR_CLIENT__', ssr ? '!import.meta.env.SSR' : 'false')
46
- .replaceAll('__QUASAR_SSR_PWA__', ssr && pwa ? '!import.meta.env.SSR' : 'false');
44
+ .replaceAll('__QUASAR_SSR_SERVER__', ssr ? '(import.meta.env.SSR === true)' : 'false')
45
+ .replaceAll('__QUASAR_SSR_CLIENT__', ssr ? '(import.meta.env.SSR === false)' : 'false')
46
+ .replaceAll('__QUASAR_SSR_PWA__', ssr && pwa ? '(import.meta.env.SSR === false)' : 'false');
47
47
  return code;
48
48
  }
49
49
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitrify",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "license": "MIT",
5
5
  "author": "Stefan van Herwijnen",
6
6
  "description": "Pre-configured Vite CLI for your framework",
@@ -60,6 +60,7 @@
60
60
  "@fastify/static": "^6.5.0",
61
61
  "@quasar/extras": "^1.15.1",
62
62
  "@vitejs/plugin-vue": "^3.0.1",
63
+ "@vitrify/plugin-env": "^0.1.0",
63
64
  "builtin-modules": "^3.3.0",
64
65
  "cac": "^6.7.12",
65
66
  "chalk": "^5.0.1",
package/src/node/index.ts CHANGED
@@ -23,6 +23,7 @@ import type { VitrifyContext } from './bin/run.js'
23
23
  import type { VitrifyPlugin } from './plugins/index.js'
24
24
  import { resolve } from './app-urls.js'
25
25
  import type { ManualChunksOption, RollupOptions } from 'rollup'
26
+ import envPlugin from '@vitrify/plugin-env'
26
27
 
27
28
  const internalServerModules = [
28
29
  'util',
@@ -269,6 +270,7 @@ export const baseConfig = async ({
269
270
 
270
271
  const plugins: UserConfig['plugins'] = [
271
272
  vuePlugin(),
273
+ envPlugin(),
272
274
  ...frameworkPlugins,
273
275
  {
274
276
  name: 'vitrify-setup',
@@ -84,20 +84,20 @@ export const QuasarPlugin: VitrifyPlugin = async ({
84
84
  name: 'vite-plugin-quasar-transform',
85
85
  enforce: 'pre',
86
86
  transform: (code, id, options) => {
87
- const { ssr: transformSsr } = options || {}
87
+ const { ssr } = options || {}
88
88
  code = code
89
89
  .replaceAll('__QUASAR_SSR__', ssr ? 'true' : 'false')
90
90
  .replaceAll(
91
91
  '__QUASAR_SSR_SERVER__',
92
- ssr === 'server' ? 'import.meta.env.SSR' : 'false'
92
+ ssr ? '(import.meta.env.SSR === true)' : 'false'
93
93
  )
94
94
  .replaceAll(
95
95
  '__QUASAR_SSR_CLIENT__',
96
- ssr ? '!import.meta.env.SSR' : 'false'
96
+ ssr ? '(import.meta.env.SSR === false)' : 'false'
97
97
  )
98
98
  .replaceAll(
99
99
  '__QUASAR_SSR_PWA__',
100
- ssr && pwa ? '!import.meta.env.SSR' : 'false'
100
+ ssr && pwa ? '(import.meta.env.SSR === false)' : 'false'
101
101
  )
102
102
 
103
103
  return code
@@ -23,4 +23,5 @@ export const setupApp = async () => {
23
23
  })
24
24
  }
25
25
 
26
+ export { default as vitrifyConfig } from 'virtual:vitrify-config'
26
27
  export { onRendered }