vitrify 0.7.1 → 0.7.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.
@@ -2,9 +2,6 @@ import fastifyStatic from '@fastify/static';
2
2
  import { readFileSync } from 'fs';
3
3
  import { componentsModules, collectCss } from '../../helpers/collect-css-ssr.js';
4
4
  const fastifySsrPlugin = async (fastify, options, done) => {
5
- options.vitrifyDir =
6
- options.vitrifyDir || (await import('vitrify')).vitrifyDir;
7
- const frameworkDir = new URL('src/vite/vue/', options.vitrifyDir);
8
5
  options.baseUrl = options.baseUrl || '/';
9
6
  options.mode = options.mode || process.env.MODE || import.meta.env.MODE;
10
7
  options.appDir = options.appDir || new URL('../../..', import.meta.url);
@@ -12,6 +9,9 @@ const fastifySsrPlugin = async (fastify, options, done) => {
12
9
  options.baseUrl.charAt(0) !== '/')
13
10
  throw new Error('baseUrl should start and end with a /');
14
11
  if (options.mode === 'development') {
12
+ options.vitrifyDir =
13
+ options.vitrifyDir || (await import('vitrify')).vitrifyDir;
14
+ const frameworkDir = new URL('src/vite/vue/', options.vitrifyDir);
15
15
  // if (!options.vitrifyDir)
16
16
  // throw new Error('Option vitrifyDir cannot be undefined')
17
17
  // if (!options.vite) throw new Error('Option vite cannot be undefined')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitrify",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "license": "MIT",
5
5
  "author": "Stefan van Herwijnen",
6
6
  "description": "Pre-configured Vite CLI for your framework",
@@ -30,9 +30,6 @@ const fastifySsrPlugin: FastifyPluginCallback<FastifySsrOptions> = async (
30
30
  options,
31
31
  done
32
32
  ) => {
33
- options.vitrifyDir =
34
- options.vitrifyDir || (await import('vitrify')).vitrifyDir
35
- const frameworkDir = new URL('src/vite/vue/', options.vitrifyDir)
36
33
  options.baseUrl = options.baseUrl || '/'
37
34
  options.mode = options.mode || process.env.MODE || import.meta.env.MODE
38
35
  options.appDir = options.appDir || new URL('../../..', import.meta.url)
@@ -43,6 +40,9 @@ const fastifySsrPlugin: FastifyPluginCallback<FastifySsrOptions> = async (
43
40
  )
44
41
  throw new Error('baseUrl should start and end with a /')
45
42
  if (options.mode === 'development') {
43
+ options.vitrifyDir =
44
+ options.vitrifyDir || (await import('vitrify')).vitrifyDir
45
+ const frameworkDir = new URL('src/vite/vue/', options.vitrifyDir)
46
46
  // if (!options.vitrifyDir)
47
47
  // throw new Error('Option vitrifyDir cannot be undefined')
48
48
  // if (!options.vite) throw new Error('Option vite cannot be undefined')