vitrify 0.5.7 → 0.5.10
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 +3 -2
- package/dist/plugins/quasar.js +89 -63
- package/dist/types/bin/dev.d.ts +1 -1
- package/package.json +17 -17
- package/src/node/index.ts +3 -2
- package/src/node/plugins/quasar.ts +40 -18
package/dist/index.js
CHANGED
|
@@ -460,7 +460,8 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
462
|
const config = {
|
|
463
|
-
root: ssr === 'fastify' ? appDir.pathname : frameworkDir.pathname,
|
|
463
|
+
// root: ssr === 'fastify' ? appDir.pathname : frameworkDir.pathname,
|
|
464
|
+
root: appDir.pathname,
|
|
464
465
|
publicDir: publicDir.pathname,
|
|
465
466
|
base,
|
|
466
467
|
envDir: appDir.pathname,
|
|
@@ -476,7 +477,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
476
477
|
},
|
|
477
478
|
plugins,
|
|
478
479
|
optimizeDeps: {
|
|
479
|
-
exclude: ['vue', ...serverModules, ...builtinModules]
|
|
480
|
+
exclude: ['vue', 'vue-router', ...serverModules, ...builtinModules]
|
|
480
481
|
},
|
|
481
482
|
resolve: {
|
|
482
483
|
dedupe: ['vue', '@vue/server-renderer', 'vue-router'],
|
package/dist/plugins/quasar.js
CHANGED
|
@@ -39,12 +39,12 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
39
39
|
name: 'vite-plugin-quasar-transform',
|
|
40
40
|
enforce: 'pre',
|
|
41
41
|
transform: (code, id, options) => {
|
|
42
|
-
const { ssr } = options || {};
|
|
42
|
+
const { ssr: transformSsr } = options || {};
|
|
43
43
|
code = code
|
|
44
|
-
.replaceAll('__QUASAR_SSR__', ssr ?
|
|
45
|
-
.replaceAll('__QUASAR_SSR_SERVER__',
|
|
46
|
-
.replaceAll('__QUASAR_SSR_CLIENT__',
|
|
47
|
-
.replaceAll('__QUASAR_SSR_PWA__',
|
|
44
|
+
.replaceAll('__QUASAR_SSR__', ssr ? 'true' : 'false')
|
|
45
|
+
.replaceAll('__QUASAR_SSR_SERVER__', 'import.meta.env.SSR')
|
|
46
|
+
.replaceAll('__QUASAR_SSR_CLIENT__', '!import.meta.env.SSR')
|
|
47
|
+
.replaceAll('__QUASAR_SSR_PWA__', pwa ? '!import.meta.env.SSR' : 'false');
|
|
48
48
|
return code;
|
|
49
49
|
}
|
|
50
50
|
},
|
|
@@ -72,7 +72,7 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
72
72
|
// @ts-ignore
|
|
73
73
|
const quasarPlugins = await import('virtual:quasar-plugins');
|
|
74
74
|
// @ts-ignore
|
|
75
|
-
const directives = await import('quasar
|
|
75
|
+
const directives = await import('virtual:quasar-directives');
|
|
76
76
|
app.use(staticImports?.Quasar, {
|
|
77
77
|
plugins: quasarPlugins,
|
|
78
78
|
directives
|
|
@@ -130,63 +130,80 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
130
130
|
plugins = quasarConf?.framework.plugins;
|
|
131
131
|
}
|
|
132
132
|
return {
|
|
133
|
+
// build: {
|
|
134
|
+
// rollupOptions: {
|
|
135
|
+
// treeshake: {
|
|
136
|
+
// moduleSideEffects: 'no-external'
|
|
137
|
+
// }
|
|
138
|
+
// }
|
|
139
|
+
// },
|
|
133
140
|
resolve: {
|
|
134
|
-
dedupe: ['quasar', '@quasar/extras'],
|
|
141
|
+
// dedupe: ['quasar', '@quasar/extras'],
|
|
135
142
|
alias: [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
143
|
+
// {
|
|
144
|
+
// find: 'quasar/wrappers',
|
|
145
|
+
// replacement: new URL('quasar-wrappers.ts', urls?.cli).pathname
|
|
146
|
+
// },
|
|
147
|
+
// {
|
|
148
|
+
// find: 'quasar/vue-plugin',
|
|
149
|
+
// replacement: new URL(
|
|
150
|
+
// 'src/vue-plugin.js',
|
|
151
|
+
// urls?.packages?.quasar
|
|
152
|
+
// ).pathname
|
|
153
|
+
// },
|
|
154
|
+
// {
|
|
155
|
+
// find: 'quasar/plugins',
|
|
156
|
+
// replacement: new URL('src/plugins.js', urls?.packages?.quasar)
|
|
157
|
+
// .pathname
|
|
158
|
+
// },
|
|
159
|
+
// {
|
|
160
|
+
// find: 'quasar/components',
|
|
161
|
+
// replacement: new URL(
|
|
162
|
+
// 'src/components.js',
|
|
163
|
+
// urls?.packages?.quasar
|
|
164
|
+
// ).pathname
|
|
165
|
+
// },
|
|
166
|
+
// {
|
|
167
|
+
// find: 'quasar/composables',
|
|
168
|
+
// replacement: new URL(
|
|
169
|
+
// 'src/composables.js',
|
|
170
|
+
// urls?.packages?.quasar
|
|
171
|
+
// ).pathname
|
|
172
|
+
// },
|
|
173
|
+
// {
|
|
174
|
+
// find: 'quasar/directives',
|
|
175
|
+
// replacement: new URL(
|
|
176
|
+
// 'src/directives.js',
|
|
177
|
+
// urls?.packages?.quasar
|
|
178
|
+
// ).pathname
|
|
179
|
+
// },
|
|
180
|
+
{
|
|
181
|
+
find: 'quasar/src',
|
|
182
|
+
replacement: new URL('node_modules/quasar/src/', config.vitrify?.urls?.app).pathname
|
|
183
|
+
}
|
|
184
|
+
// {
|
|
185
|
+
// find: 'quasar',
|
|
186
|
+
// replacement: new URL(
|
|
187
|
+
// 'node_modules/quasar',
|
|
188
|
+
// config.vitrify?.urls?.app
|
|
189
|
+
// )
|
|
190
|
+
// }
|
|
191
|
+
// {
|
|
192
|
+
// find: new RegExp('^quasar$'),
|
|
193
|
+
// replacement: new URL('src/index.all.js', urls?.packages?.quasar)
|
|
194
|
+
// .pathname
|
|
195
|
+
// },
|
|
196
|
+
// {
|
|
197
|
+
// find: `@quasar/extras`,
|
|
198
|
+
// replacement: new URL('.', urls?.packages?.['@quasar/extras'])
|
|
199
|
+
// .pathname
|
|
200
|
+
// }
|
|
201
|
+
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
188
202
|
]
|
|
189
203
|
},
|
|
204
|
+
optimizeDeps: {
|
|
205
|
+
exclude: ['quasar']
|
|
206
|
+
},
|
|
190
207
|
define: {
|
|
191
208
|
__DEV__: process.env.NODE_ENV !== 'production' || true,
|
|
192
209
|
__QUASAR_VERSION__: `'${version}'`
|
|
@@ -210,7 +227,11 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
210
227
|
config: async (config, env) => ({
|
|
211
228
|
resolve: {
|
|
212
229
|
alias: [
|
|
213
|
-
|
|
230
|
+
{
|
|
231
|
+
find: new RegExp('^quasar$'),
|
|
232
|
+
replacement: 'virtual:quasar'
|
|
233
|
+
}
|
|
234
|
+
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
214
235
|
]
|
|
215
236
|
}
|
|
216
237
|
}),
|
|
@@ -218,8 +239,10 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
218
239
|
switch (id) {
|
|
219
240
|
case 'virtual:quasar-plugins':
|
|
220
241
|
return 'virtual:quasar-plugins';
|
|
221
|
-
case 'quasar':
|
|
222
|
-
return
|
|
242
|
+
case 'virtual:quasar-directives':
|
|
243
|
+
return 'virtual:quasar-directives';
|
|
244
|
+
case 'virtual:quasar':
|
|
245
|
+
return { id: 'virtual:quasar', moduleSideEffects: false };
|
|
223
246
|
default:
|
|
224
247
|
return;
|
|
225
248
|
}
|
|
@@ -228,7 +251,10 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
228
251
|
if (id === 'virtual:quasar-plugins') {
|
|
229
252
|
return `export { ${plugins.join(',')} } from 'quasar'`;
|
|
230
253
|
}
|
|
231
|
-
else if (id === 'quasar') {
|
|
254
|
+
else if (id === 'virtual:quasar-directives') {
|
|
255
|
+
return `export * from 'quasar/src/directives.js'`;
|
|
256
|
+
}
|
|
257
|
+
else if (id === 'virtual:quasar') {
|
|
232
258
|
return `export * from 'quasar/src/plugins.js';
|
|
233
259
|
export * from 'quasar/src/components.js';
|
|
234
260
|
export * from 'quasar/src/composables.js';
|
package/dist/types/bin/dev.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare function createServer({ port, logLevel, ssr, framework, host, app
|
|
|
22
22
|
publicDir?: URL;
|
|
23
23
|
}): Promise<{
|
|
24
24
|
server: Server;
|
|
25
|
-
config: Readonly<Omit<import("vite").UserConfig, "
|
|
25
|
+
config: Readonly<Omit<import("vite").UserConfig, "optimizeDeps" | "plugins" | "assetsInclude" | "worker"> & {
|
|
26
26
|
configFile: string | undefined;
|
|
27
27
|
configFileDependencies: string[];
|
|
28
28
|
inlineConfig: InlineConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Pre-configured Vite CLI for your framework",
|
|
@@ -54,46 +54,46 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@fastify/middie": "^8.0.0",
|
|
56
56
|
"@fastify/static": "^6.4.0",
|
|
57
|
-
"@quasar/extras": "^1.14.
|
|
57
|
+
"@quasar/extras": "^1.14.1",
|
|
58
58
|
"@vitejs/plugin-vue": "^3.0.0-alpha.1",
|
|
59
59
|
"builtin-modules": "^3.3.0",
|
|
60
60
|
"cac": "^6.7.12",
|
|
61
61
|
"chalk": "^5.0.1",
|
|
62
|
+
"critters": "^0.0.16",
|
|
62
63
|
"cross-env": "^7.0.3",
|
|
63
|
-
"esbuild": "^0.14.
|
|
64
|
-
"fastify": "^4.
|
|
64
|
+
"esbuild": "^0.14.47",
|
|
65
|
+
"fastify": "^4.2.0",
|
|
65
66
|
"glob": "^8.0.3",
|
|
66
|
-
"happy-dom": "^5.
|
|
67
|
+
"happy-dom": "^5.3.4",
|
|
67
68
|
"magic-string": "^0.26.2",
|
|
68
69
|
"merge-deep": "^3.0.3",
|
|
69
70
|
"readline": "^1.3.0",
|
|
70
71
|
"rollup-plugin-visualizer": "^5.6.0",
|
|
71
|
-
"sass": "1.
|
|
72
|
+
"sass": "1.53.0",
|
|
72
73
|
"ts-node": "^10.8.1",
|
|
73
|
-
"unplugin-vue-components": "^0.
|
|
74
|
+
"unplugin-vue-components": "^0.20.1",
|
|
74
75
|
"vite": "^3.0.0-beta.0",
|
|
75
|
-
"vitest": "^0.
|
|
76
|
+
"vitest": "^0.16.0"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
78
79
|
"@types/connect": "^3.4.35",
|
|
79
80
|
"@types/glob": "^7.2.0",
|
|
80
81
|
"@types/merge-deep": "^3.0.0",
|
|
81
|
-
"@types/node": "^
|
|
82
|
+
"@types/node": "^18.0.0",
|
|
82
83
|
"@types/ws": "^8.5.3",
|
|
83
84
|
"@vue/runtime-core": "^3.2.37",
|
|
84
|
-
"quasar": "^2.7.
|
|
85
|
-
"rollup": "^2.75.
|
|
86
|
-
"typescript": "^4.7.
|
|
87
|
-
"vite": "^3.0.0-alpha.11",
|
|
85
|
+
"quasar": "^2.7.3",
|
|
86
|
+
"rollup": "^2.75.7",
|
|
87
|
+
"typescript": "^4.7.4",
|
|
88
88
|
"vue": "^3.2.37",
|
|
89
|
-
"vue-router": "^4.0.
|
|
89
|
+
"vue-router": "^4.0.16"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@fastify/static": "^6.4.0",
|
|
93
|
-
"fastify": "^4.
|
|
94
|
-
"quasar": "^2.7.
|
|
93
|
+
"fastify": "^4.2.0",
|
|
94
|
+
"quasar": "^2.7.3",
|
|
95
95
|
"vue": "^3.2.37",
|
|
96
|
-
"vue-router": "^4.0.
|
|
96
|
+
"vue-router": "^4.0.16"
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public",
|
package/src/node/index.ts
CHANGED
|
@@ -542,7 +542,8 @@ export const baseConfig = async ({
|
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
const config = {
|
|
545
|
-
root: ssr === 'fastify' ? appDir.pathname : frameworkDir.pathname,
|
|
545
|
+
// root: ssr === 'fastify' ? appDir.pathname : frameworkDir.pathname,
|
|
546
|
+
root: appDir.pathname,
|
|
546
547
|
publicDir: publicDir.pathname,
|
|
547
548
|
base,
|
|
548
549
|
envDir: appDir.pathname,
|
|
@@ -558,7 +559,7 @@ export const baseConfig = async ({
|
|
|
558
559
|
},
|
|
559
560
|
plugins,
|
|
560
561
|
optimizeDeps: {
|
|
561
|
-
exclude: ['vue', ...serverModules, ...builtinModules]
|
|
562
|
+
exclude: ['vue', 'vue-router', ...serverModules, ...builtinModules]
|
|
562
563
|
},
|
|
563
564
|
resolve: {
|
|
564
565
|
dedupe: ['vue', '@vue/server-renderer', 'vue-router'],
|
|
@@ -90,20 +90,14 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
90
90
|
name: 'vite-plugin-quasar-transform',
|
|
91
91
|
enforce: 'pre',
|
|
92
92
|
transform: (code, id, options) => {
|
|
93
|
-
const { ssr } = options || {}
|
|
93
|
+
const { ssr: transformSsr } = options || {}
|
|
94
94
|
code = code
|
|
95
|
-
.replaceAll('__QUASAR_SSR__', ssr ?
|
|
96
|
-
.replaceAll(
|
|
97
|
-
|
|
98
|
-
ssr ? 'import.meta.env.SSR' : 'false'
|
|
99
|
-
)
|
|
100
|
-
.replaceAll(
|
|
101
|
-
'__QUASAR_SSR_CLIENT__',
|
|
102
|
-
ssr ? '!import.meta.env.SSR' : 'false'
|
|
103
|
-
)
|
|
95
|
+
.replaceAll('__QUASAR_SSR__', ssr ? 'true' : 'false')
|
|
96
|
+
.replaceAll('__QUASAR_SSR_SERVER__', 'import.meta.env.SSR')
|
|
97
|
+
.replaceAll('__QUASAR_SSR_CLIENT__', '!import.meta.env.SSR')
|
|
104
98
|
.replaceAll(
|
|
105
99
|
'__QUASAR_SSR_PWA__',
|
|
106
|
-
|
|
100
|
+
pwa ? '!import.meta.env.SSR' : 'false'
|
|
107
101
|
)
|
|
108
102
|
|
|
109
103
|
return code
|
|
@@ -143,7 +137,7 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
143
137
|
// @ts-ignore
|
|
144
138
|
const quasarPlugins = await import('virtual:quasar-plugins')
|
|
145
139
|
// @ts-ignore
|
|
146
|
-
const directives = await import('quasar
|
|
140
|
+
const directives = await import('virtual:quasar-directives')
|
|
147
141
|
|
|
148
142
|
app.use(
|
|
149
143
|
staticImports?.Quasar,
|
|
@@ -209,8 +203,15 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
209
203
|
}
|
|
210
204
|
|
|
211
205
|
return {
|
|
206
|
+
// build: {
|
|
207
|
+
// rollupOptions: {
|
|
208
|
+
// treeshake: {
|
|
209
|
+
// moduleSideEffects: 'no-external'
|
|
210
|
+
// }
|
|
211
|
+
// }
|
|
212
|
+
// },
|
|
212
213
|
resolve: {
|
|
213
|
-
dedupe: ['quasar', '@quasar/extras'],
|
|
214
|
+
// dedupe: ['quasar', '@quasar/extras'],
|
|
214
215
|
alias: [
|
|
215
216
|
// {
|
|
216
217
|
// find: 'quasar/wrappers',
|
|
@@ -249,9 +250,19 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
249
250
|
// urls?.packages?.quasar
|
|
250
251
|
// ).pathname
|
|
251
252
|
// },
|
|
253
|
+
{
|
|
254
|
+
find: 'quasar/src',
|
|
255
|
+
replacement: new URL(
|
|
256
|
+
'node_modules/quasar/src/',
|
|
257
|
+
config.vitrify?.urls?.app
|
|
258
|
+
).pathname
|
|
259
|
+
}
|
|
252
260
|
// {
|
|
253
|
-
// find: 'quasar
|
|
254
|
-
// replacement: new URL(
|
|
261
|
+
// find: 'quasar',
|
|
262
|
+
// replacement: new URL(
|
|
263
|
+
// 'node_modules/quasar',
|
|
264
|
+
// config.vitrify?.urls?.app
|
|
265
|
+
// )
|
|
255
266
|
// }
|
|
256
267
|
// {
|
|
257
268
|
// find: new RegExp('^quasar$'),
|
|
@@ -266,6 +277,9 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
266
277
|
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
267
278
|
]
|
|
268
279
|
},
|
|
280
|
+
optimizeDeps: {
|
|
281
|
+
exclude: ['quasar']
|
|
282
|
+
},
|
|
269
283
|
define: {
|
|
270
284
|
__DEV__: process.env.NODE_ENV !== 'production' || true,
|
|
271
285
|
__QUASAR_VERSION__: `'${version}'`
|
|
@@ -289,6 +303,10 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
289
303
|
config: async (config, env) => ({
|
|
290
304
|
resolve: {
|
|
291
305
|
alias: [
|
|
306
|
+
{
|
|
307
|
+
find: new RegExp('^quasar$'),
|
|
308
|
+
replacement: 'virtual:quasar'
|
|
309
|
+
}
|
|
292
310
|
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
293
311
|
]
|
|
294
312
|
}
|
|
@@ -297,8 +315,10 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
297
315
|
switch (id) {
|
|
298
316
|
case 'virtual:quasar-plugins':
|
|
299
317
|
return 'virtual:quasar-plugins'
|
|
300
|
-
case 'quasar':
|
|
301
|
-
return
|
|
318
|
+
case 'virtual:quasar-directives':
|
|
319
|
+
return 'virtual:quasar-directives'
|
|
320
|
+
case 'virtual:quasar':
|
|
321
|
+
return { id: 'virtual:quasar', moduleSideEffects: false }
|
|
302
322
|
default:
|
|
303
323
|
return
|
|
304
324
|
}
|
|
@@ -306,7 +326,9 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
306
326
|
load(id) {
|
|
307
327
|
if (id === 'virtual:quasar-plugins') {
|
|
308
328
|
return `export { ${plugins.join(',')} } from 'quasar'`
|
|
309
|
-
} else if (id === 'quasar') {
|
|
329
|
+
} else if (id === 'virtual:quasar-directives') {
|
|
330
|
+
return `export * from 'quasar/src/directives.js'`
|
|
331
|
+
} else if (id === 'virtual:quasar') {
|
|
310
332
|
return `export * from 'quasar/src/plugins.js';
|
|
311
333
|
export * from 'quasar/src/components.js';
|
|
312
334
|
export * from 'quasar/src/composables.js';
|