vitrify 0.7.0 → 0.7.1
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/bin/dev.js +0 -1
- package/dist/frameworks/vue/server.js +5 -5
- package/dist/index.js +5 -5
- package/dist/plugins/quasar.js +16 -107
- package/dist/types/bin/dev.d.ts +1 -1
- package/dist/types/frameworks/vue/server.d.ts +2 -2
- package/package.json +7 -7
- package/src/node/bin/dev.ts +0 -1
- package/src/node/frameworks/vue/server.ts +6 -6
- package/src/node/index.ts +5 -6
- package/src/node/plugins/quasar.ts +17 -114
package/dist/bin/dev.js
CHANGED
|
@@ -84,7 +84,6 @@ ssr, framework = 'vue', host, appDir, publicDir }) {
|
|
|
84
84
|
? new URL('src/vite/fastify/entry.ts', cliDir).pathname
|
|
85
85
|
: new URL(`src/vite/${framework}/ssr/app.ts`, cliDir).pathname;
|
|
86
86
|
({ setup, onRendered, vitrifyConfig } = await vite.ssrLoadModule(entryUrl));
|
|
87
|
-
console.log(vitrifyConfig);
|
|
88
87
|
const app = fastify({
|
|
89
88
|
logger: false,
|
|
90
89
|
https: vite.config.server.https,
|
|
@@ -10,10 +10,10 @@ export const createApp = ({ onSetup, appDir, baseUrl, fastifyPlugin, onRendered,
|
|
|
10
10
|
onRendered,
|
|
11
11
|
mode
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
if (onSetup?.length) {
|
|
14
|
+
for (const setup of onSetup) {
|
|
15
|
+
setup(app);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
18
|
return app;
|
|
19
19
|
};
|
package/dist/index.js
CHANGED
|
@@ -183,7 +183,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
183
183
|
let onRenderedHooks;
|
|
184
184
|
let onMountedHooks;
|
|
185
185
|
let onSetupFiles;
|
|
186
|
-
let globalCss;
|
|
186
|
+
let globalCss = [];
|
|
187
187
|
let staticImports;
|
|
188
188
|
let sassVariables;
|
|
189
189
|
let additionalData;
|
|
@@ -200,7 +200,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
200
200
|
{
|
|
201
201
|
name: 'vitrify-setup',
|
|
202
202
|
enforce: 'post',
|
|
203
|
-
config:
|
|
203
|
+
config: (config, env) => {
|
|
204
204
|
onBootHooks = config.vitrify?.hooks?.onBoot || [];
|
|
205
205
|
onRenderedHooks = config.vitrify?.hooks?.onRendered || [];
|
|
206
206
|
onMountedHooks = config.vitrify?.hooks?.onMounted || [];
|
|
@@ -210,7 +210,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
210
210
|
sassVariables = config.vitrify?.sass?.variables || {};
|
|
211
211
|
globalSass = config.vitrify?.sass?.global || [];
|
|
212
212
|
additionalData = config.vitrify?.sass?.additionalData || [];
|
|
213
|
-
return
|
|
213
|
+
return;
|
|
214
214
|
},
|
|
215
215
|
configureServer(server) {
|
|
216
216
|
server.middlewares.use('/', (req, res, next) => {
|
|
@@ -221,8 +221,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
221
221
|
},
|
|
222
222
|
configResolved: (config) => {
|
|
223
223
|
if (process.env.DEBUG) {
|
|
224
|
-
console.log(config
|
|
225
|
-
console.log(config.optimizeDeps);
|
|
224
|
+
console.log(config);
|
|
226
225
|
}
|
|
227
226
|
},
|
|
228
227
|
resolveId(id) {
|
|
@@ -327,6 +326,7 @@ export const baseConfig = async ({ ssr, appDir, publicDir, base = '/', command =
|
|
|
327
326
|
config: (config, env) => {
|
|
328
327
|
if (config.vitrify?.productName)
|
|
329
328
|
productName = config.vitrify?.productName;
|
|
329
|
+
return;
|
|
330
330
|
},
|
|
331
331
|
transformIndexHtml: {
|
|
332
332
|
enforce: 'post',
|
package/dist/plugins/quasar.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { resolvePackageData } from 'vite';
|
|
2
2
|
import Components from 'unplugin-vue-components/vite';
|
|
3
|
-
// import { quasarDir as defaultQuasarDir } from '../app-urls.js'
|
|
4
|
-
// import { QuasarResolver } from '../resolver.js';
|
|
5
3
|
import { QuasarResolver } from 'unplugin-vue-components/resolvers';
|
|
6
4
|
export const injectSsrContext = (html, ssrContext) => html
|
|
7
5
|
.replace(/(<html[^>]*)(>)/i, (found, start, end) => {
|
|
@@ -86,45 +84,10 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
86
84
|
}, ssrContext);
|
|
87
85
|
}
|
|
88
86
|
];
|
|
89
|
-
return {
|
|
90
|
-
vitrify: {
|
|
91
|
-
urls,
|
|
92
|
-
globalCss,
|
|
93
|
-
staticImports: {
|
|
94
|
-
quasar: ['Quasar']
|
|
95
|
-
},
|
|
96
|
-
hooks: {
|
|
97
|
-
onBoot: onBootHooks,
|
|
98
|
-
onMounted: onMountedHooks,
|
|
99
|
-
onRendered: [injectSsrContext]
|
|
100
|
-
},
|
|
101
|
-
sass: {
|
|
102
|
-
global: ['quasar/src/css/index.sass']
|
|
103
|
-
// additionalData: [`@import 'quasar/src/css/index.sass'`]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'vite-plugin-quasar',
|
|
111
|
-
enforce: 'post',
|
|
112
|
-
config: async (config, env) => {
|
|
113
|
-
const { quasar, vitrify: { urls } = {} } = config;
|
|
114
87
|
if (quasar)
|
|
115
88
|
quasarConf = quasar;
|
|
116
89
|
if (!quasarConf.framework.lang && config.vitrify?.lang)
|
|
117
90
|
quasarConf.framework.lang = config.vitrify.lang;
|
|
118
|
-
// const quasarPkgJsonPath = new URL(
|
|
119
|
-
// 'package.json',
|
|
120
|
-
// urls?.packages?.quasar
|
|
121
|
-
// ).pathname
|
|
122
|
-
// const { version } = JSON.parse(
|
|
123
|
-
// readFileSync(quasarPkgJsonPath, { encoding: 'utf-8' })
|
|
124
|
-
// )
|
|
125
|
-
// const { version } = await import('quasar/package.json', {
|
|
126
|
-
// assert: { type: 'json' }
|
|
127
|
-
// })
|
|
128
91
|
/**
|
|
129
92
|
* Importing package.json is problematic
|
|
130
93
|
*/
|
|
@@ -141,75 +104,28 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
141
104
|
plugins = quasarConf?.framework.plugins;
|
|
142
105
|
}
|
|
143
106
|
return {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
107
|
+
vitrify: {
|
|
108
|
+
urls,
|
|
109
|
+
globalCss,
|
|
110
|
+
staticImports: {
|
|
111
|
+
quasar: ['Quasar']
|
|
112
|
+
},
|
|
113
|
+
hooks: {
|
|
114
|
+
onBoot: onBootHooks,
|
|
115
|
+
onMounted: onMountedHooks,
|
|
116
|
+
onRendered: [injectSsrContext]
|
|
117
|
+
},
|
|
118
|
+
sass: {
|
|
119
|
+
global: ['quasar/src/css/index.sass']
|
|
120
|
+
// additionalData: [`@import 'quasar/src/css/index.sass'`]
|
|
121
|
+
}
|
|
122
|
+
},
|
|
151
123
|
resolve: {
|
|
152
|
-
// dedupe: ['quasar', '@quasar/extras'],
|
|
153
124
|
alias: [
|
|
154
|
-
// {
|
|
155
|
-
// find: 'quasar/wrappers',
|
|
156
|
-
// replacement: new URL('quasar-wrappers.ts', urls?.cli).pathname
|
|
157
|
-
// },
|
|
158
|
-
// {
|
|
159
|
-
// find: 'quasar/vue-plugin',
|
|
160
|
-
// replacement: new URL(
|
|
161
|
-
// 'src/vue-plugin.js',
|
|
162
|
-
// urls?.packages?.quasar
|
|
163
|
-
// ).pathname
|
|
164
|
-
// },
|
|
165
|
-
// {
|
|
166
|
-
// find: 'quasar/plugins',
|
|
167
|
-
// replacement: new URL('src/plugins.js', urls?.packages?.quasar)
|
|
168
|
-
// .pathname
|
|
169
|
-
// },
|
|
170
|
-
// {
|
|
171
|
-
// find: 'quasar/components',
|
|
172
|
-
// replacement: new URL(
|
|
173
|
-
// 'src/components.js',
|
|
174
|
-
// urls?.packages?.quasar
|
|
175
|
-
// ).pathname
|
|
176
|
-
// },
|
|
177
|
-
// {
|
|
178
|
-
// find: 'quasar/composables',
|
|
179
|
-
// replacement: new URL(
|
|
180
|
-
// 'src/composables.js',
|
|
181
|
-
// urls?.packages?.quasar
|
|
182
|
-
// ).pathname
|
|
183
|
-
// },
|
|
184
|
-
// {
|
|
185
|
-
// find: 'quasar/directives',
|
|
186
|
-
// replacement: new URL(
|
|
187
|
-
// 'src/directives.js',
|
|
188
|
-
// urls?.packages?.quasar
|
|
189
|
-
// ).pathname
|
|
190
|
-
// },
|
|
191
125
|
{
|
|
192
126
|
find: 'quasar/src/',
|
|
193
127
|
replacement: new URL('./src/', config.vitrify.urls.packages.quasar).pathname
|
|
194
128
|
}
|
|
195
|
-
// {
|
|
196
|
-
// find: 'quasar',
|
|
197
|
-
// replacement: new URL(
|
|
198
|
-
// 'node_modules/quasar',
|
|
199
|
-
// config.vitrify?.urls?.app
|
|
200
|
-
// )
|
|
201
|
-
// }
|
|
202
|
-
// {
|
|
203
|
-
// find: new RegExp('^quasar$'),
|
|
204
|
-
// replacement: new URL('src/index.all.js', urls?.packages?.quasar)
|
|
205
|
-
// .pathname
|
|
206
|
-
// }
|
|
207
|
-
// {
|
|
208
|
-
// find: `@quasar/extras`,
|
|
209
|
-
// replacement: new URL('.', urls?.packages?.['@quasar/extras'])
|
|
210
|
-
// .pathname
|
|
211
|
-
// }
|
|
212
|
-
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
213
129
|
]
|
|
214
130
|
},
|
|
215
131
|
optimizeDeps: {
|
|
@@ -218,13 +134,6 @@ export const QuasarPlugin = async ({ ssr = false, pwa = false }) => {
|
|
|
218
134
|
define: {
|
|
219
135
|
__DEV__: process.env.NODE_ENV !== 'production' || true,
|
|
220
136
|
__QUASAR_VERSION__: `'${version}'`
|
|
221
|
-
// __QUASAR_SSR__: !!ssr,
|
|
222
|
-
// // __QUASAR_SSR_SERVER__: ssr === 'server',
|
|
223
|
-
// __QUASAR_SSR_SERVER__: `import.meta.env.SSR`,
|
|
224
|
-
// // __QUASAR_SSR_CLIENT__: ssr === 'client',
|
|
225
|
-
// __QUASAR_SSR_CLIENT__: `!import.meta.env.SSR`,
|
|
226
|
-
// // __QUASAR_SSR_PWA__: ssr === 'client' && pwa
|
|
227
|
-
// __QUASAR_SSR_PWA__: pwa ? `!import.meta.env.SSR` : false
|
|
228
137
|
},
|
|
229
138
|
ssr: {
|
|
230
139
|
noExternal: ['quasar']
|
package/dist/types/bin/dev.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function createServer({ port, logLevel, ssr, framework, host, app
|
|
|
21
21
|
publicDir?: URL;
|
|
22
22
|
}): Promise<{
|
|
23
23
|
server: Server;
|
|
24
|
-
config: Readonly<Omit<import("vite").UserConfig, "
|
|
24
|
+
config: Readonly<Omit<import("vite").UserConfig, "plugins" | "assetsInclude" | "optimizeDeps" | "worker"> & {
|
|
25
25
|
configFile: string | undefined;
|
|
26
26
|
configFileDependencies: string[];
|
|
27
27
|
inlineConfig: InlineConfig;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { FastifyInstance } from 'fastify';
|
|
3
|
-
import type { OnRenderedHook
|
|
3
|
+
import type { OnRenderedHook } from '../../vitrify-config.js';
|
|
4
4
|
import type { FastifyCsrPlugin } from './fastify-csr-plugin.js';
|
|
5
5
|
import type { FastifySsrPlugin } from './fastify-ssr-plugin.js';
|
|
6
6
|
export declare const createApp: ({ onSetup, appDir, baseUrl, fastifyPlugin, onRendered, vitrifyDir, mode }: {
|
|
7
|
-
onSetup:
|
|
7
|
+
onSetup: ((fastify: FastifyInstance) => void)[];
|
|
8
8
|
appDir: URL;
|
|
9
9
|
baseUrl?: string | undefined;
|
|
10
10
|
fastifyPlugin: FastifySsrPlugin | FastifyCsrPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitrify",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Stefan van Herwijnen",
|
|
6
6
|
"description": "Pre-configured Vite CLI for your framework",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"chalk": "^5.0.1",
|
|
66
66
|
"critters": "^0.0.16",
|
|
67
67
|
"cross-env": "^7.0.3",
|
|
68
|
-
"esbuild": "^0.14.
|
|
68
|
+
"esbuild": "^0.14.53",
|
|
69
69
|
"fastify": "^4.3.0",
|
|
70
70
|
"glob": "^8.0.3",
|
|
71
71
|
"happy-dom": "^6.0.4",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"merge-deep": "^3.0.3",
|
|
74
74
|
"readline": "^1.3.0",
|
|
75
75
|
"rollup-plugin-visualizer": "^5.7.1",
|
|
76
|
-
"sass": "1.54.
|
|
76
|
+
"sass": "1.54.2",
|
|
77
77
|
"ts-node": "^10.9.1",
|
|
78
|
-
"unplugin-vue-components": "^0.
|
|
78
|
+
"unplugin-vue-components": "^0.22.0",
|
|
79
79
|
"vite": "^3.0.4",
|
|
80
|
-
"vitest": "^0.20.
|
|
80
|
+
"vitest": "^0.20.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/connect": "^3.4.35",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/node": "^18.6.3",
|
|
87
87
|
"@types/ws": "^8.5.3",
|
|
88
88
|
"@vue/runtime-core": "^3.2.37",
|
|
89
|
-
"quasar": "^2.7.
|
|
89
|
+
"quasar": "^2.7.7",
|
|
90
90
|
"rollup": "^2.77.2",
|
|
91
91
|
"typescript": "^4.7.4",
|
|
92
92
|
"vue": "^3.2.37",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"peerDependencies": {
|
|
96
96
|
"@fastify/static": "^6.5.0",
|
|
97
97
|
"fastify": "^4.3.0",
|
|
98
|
-
"quasar": "^2.7.
|
|
98
|
+
"quasar": "^2.7.7",
|
|
99
99
|
"vue": "^3.2.37",
|
|
100
100
|
"vue-router": "^4.1.3"
|
|
101
101
|
},
|
package/src/node/bin/dev.ts
CHANGED
|
@@ -138,7 +138,6 @@ export async function createServer({
|
|
|
138
138
|
: new URL(`src/vite/${framework}/ssr/app.ts`, cliDir).pathname
|
|
139
139
|
|
|
140
140
|
;({ setup, onRendered, vitrifyConfig } = await vite.ssrLoadModule(entryUrl))
|
|
141
|
-
console.log(vitrifyConfig)
|
|
142
141
|
const app = fastify({
|
|
143
142
|
logger: false,
|
|
144
143
|
https: vite.config.server.https,
|
|
@@ -15,7 +15,7 @@ export const createApp = ({
|
|
|
15
15
|
vitrifyDir,
|
|
16
16
|
mode
|
|
17
17
|
}: {
|
|
18
|
-
onSetup:
|
|
18
|
+
onSetup: ((fastify: FastifyInstance) => void)[]
|
|
19
19
|
appDir: URL
|
|
20
20
|
baseUrl?: string
|
|
21
21
|
fastifyPlugin: FastifySsrPlugin | FastifyCsrPlugin
|
|
@@ -35,11 +35,11 @@ export const createApp = ({
|
|
|
35
35
|
mode
|
|
36
36
|
})
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
if (onSetup?.length) {
|
|
39
|
+
for (const setup of onSetup) {
|
|
40
|
+
setup(app)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
43
|
|
|
44
44
|
return app
|
|
45
45
|
}
|
package/src/node/index.ts
CHANGED
|
@@ -254,7 +254,7 @@ export const baseConfig = async ({
|
|
|
254
254
|
let onRenderedHooks: OnRenderedHook[]
|
|
255
255
|
let onMountedHooks: OnMountedHook[]
|
|
256
256
|
let onSetupFiles: OnSetupFile[]
|
|
257
|
-
let globalCss: string[]
|
|
257
|
+
let globalCss: string[] = []
|
|
258
258
|
let staticImports: StaticImports
|
|
259
259
|
let sassVariables: Record<string, string>
|
|
260
260
|
let additionalData: string[]
|
|
@@ -273,7 +273,7 @@ export const baseConfig = async ({
|
|
|
273
273
|
{
|
|
274
274
|
name: 'vitrify-setup',
|
|
275
275
|
enforce: 'post',
|
|
276
|
-
config:
|
|
276
|
+
config: (config: VitrifyConfig, env) => {
|
|
277
277
|
onBootHooks = config.vitrify?.hooks?.onBoot || []
|
|
278
278
|
onRenderedHooks = config.vitrify?.hooks?.onRendered || []
|
|
279
279
|
onMountedHooks = config.vitrify?.hooks?.onMounted || []
|
|
@@ -283,8 +283,7 @@ export const baseConfig = async ({
|
|
|
283
283
|
sassVariables = config.vitrify?.sass?.variables || {}
|
|
284
284
|
globalSass = config.vitrify?.sass?.global || []
|
|
285
285
|
additionalData = config.vitrify?.sass?.additionalData || []
|
|
286
|
-
|
|
287
|
-
return {}
|
|
286
|
+
return
|
|
288
287
|
},
|
|
289
288
|
configureServer(server) {
|
|
290
289
|
server.middlewares.use('/', (req, res, next) => {
|
|
@@ -294,8 +293,7 @@ export const baseConfig = async ({
|
|
|
294
293
|
},
|
|
295
294
|
configResolved: (config) => {
|
|
296
295
|
if (process.env.DEBUG) {
|
|
297
|
-
console.log(config
|
|
298
|
-
console.log(config.optimizeDeps)
|
|
296
|
+
console.log(config)
|
|
299
297
|
}
|
|
300
298
|
},
|
|
301
299
|
resolveId(id) {
|
|
@@ -398,6 +396,7 @@ export const baseConfig = async ({
|
|
|
398
396
|
config: (config: VitrifyConfig, env) => {
|
|
399
397
|
if (config.vitrify?.productName)
|
|
400
398
|
productName = config.vitrify?.productName
|
|
399
|
+
return
|
|
401
400
|
},
|
|
402
401
|
transformIndexHtml: {
|
|
403
402
|
enforce: 'post',
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { readFileSync } from 'fs'
|
|
2
1
|
import type { Plugin } from 'vite'
|
|
3
2
|
import { resolvePackageData } from 'vite'
|
|
4
3
|
import Components from 'unplugin-vue-components/vite'
|
|
5
|
-
// import { prepareQuasarConf } from './quasar-conf-file.js'
|
|
6
4
|
import type {
|
|
7
|
-
BootFunction,
|
|
8
5
|
OnBootHook,
|
|
9
6
|
OnMountedHook,
|
|
10
7
|
VitrifyConfig
|
|
11
8
|
} from '../vitrify-config.js'
|
|
12
|
-
// import { quasarDir as defaultQuasarDir } from '../app-urls.js'
|
|
13
|
-
// import { QuasarResolver } from '../resolver.js';
|
|
14
9
|
import { QuasarResolver } from 'unplugin-vue-components/resolvers'
|
|
15
10
|
import type { VitrifyPlugin } from './index.js'
|
|
16
|
-
import { getPkgJsonDir, resolve } from '../app-urls.js'
|
|
17
|
-
|
|
18
|
-
// import { resolve } from 'import-meta-resolve'
|
|
19
|
-
|
|
20
11
|
export interface QuasarConf {
|
|
21
12
|
ctx: Record<string, any>
|
|
22
13
|
css: string[]
|
|
@@ -165,44 +156,10 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
165
156
|
}
|
|
166
157
|
]
|
|
167
158
|
|
|
168
|
-
return {
|
|
169
|
-
vitrify: {
|
|
170
|
-
urls,
|
|
171
|
-
globalCss,
|
|
172
|
-
staticImports: {
|
|
173
|
-
quasar: ['Quasar']
|
|
174
|
-
},
|
|
175
|
-
hooks: {
|
|
176
|
-
onBoot: onBootHooks,
|
|
177
|
-
onMounted: onMountedHooks,
|
|
178
|
-
onRendered: [injectSsrContext]
|
|
179
|
-
},
|
|
180
|
-
sass: {
|
|
181
|
-
global: ['quasar/src/css/index.sass']
|
|
182
|
-
// additionalData: [`@import 'quasar/src/css/index.sass'`]
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: 'vite-plugin-quasar',
|
|
190
|
-
enforce: 'post',
|
|
191
|
-
config: async (config: VitrifyConfig, env) => {
|
|
192
|
-
const { quasar, vitrify: { urls } = {} } = config
|
|
193
159
|
if (quasar) quasarConf = quasar
|
|
194
160
|
if (!quasarConf.framework.lang && config.vitrify?.lang)
|
|
195
161
|
quasarConf.framework.lang = config.vitrify.lang
|
|
196
|
-
|
|
197
|
-
// 'package.json',
|
|
198
|
-
// urls?.packages?.quasar
|
|
199
|
-
// ).pathname
|
|
200
|
-
// const { version } = JSON.parse(
|
|
201
|
-
// readFileSync(quasarPkgJsonPath, { encoding: 'utf-8' })
|
|
202
|
-
// )
|
|
203
|
-
// const { version } = await import('quasar/package.json', {
|
|
204
|
-
// assert: { type: 'json' }
|
|
205
|
-
// })
|
|
162
|
+
|
|
206
163
|
/**
|
|
207
164
|
* Importing package.json is problematic
|
|
208
165
|
*/
|
|
@@ -220,53 +177,24 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
220
177
|
}
|
|
221
178
|
|
|
222
179
|
return {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
180
|
+
vitrify: {
|
|
181
|
+
urls,
|
|
182
|
+
globalCss,
|
|
183
|
+
staticImports: {
|
|
184
|
+
quasar: ['Quasar']
|
|
185
|
+
},
|
|
186
|
+
hooks: {
|
|
187
|
+
onBoot: onBootHooks,
|
|
188
|
+
onMounted: onMountedHooks,
|
|
189
|
+
onRendered: [injectSsrContext]
|
|
190
|
+
},
|
|
191
|
+
sass: {
|
|
192
|
+
global: ['quasar/src/css/index.sass']
|
|
193
|
+
// additionalData: [`@import 'quasar/src/css/index.sass'`]
|
|
194
|
+
}
|
|
195
|
+
},
|
|
230
196
|
resolve: {
|
|
231
|
-
// dedupe: ['quasar', '@quasar/extras'],
|
|
232
197
|
alias: [
|
|
233
|
-
// {
|
|
234
|
-
// find: 'quasar/wrappers',
|
|
235
|
-
// replacement: new URL('quasar-wrappers.ts', urls?.cli).pathname
|
|
236
|
-
// },
|
|
237
|
-
// {
|
|
238
|
-
// find: 'quasar/vue-plugin',
|
|
239
|
-
// replacement: new URL(
|
|
240
|
-
// 'src/vue-plugin.js',
|
|
241
|
-
// urls?.packages?.quasar
|
|
242
|
-
// ).pathname
|
|
243
|
-
// },
|
|
244
|
-
// {
|
|
245
|
-
// find: 'quasar/plugins',
|
|
246
|
-
// replacement: new URL('src/plugins.js', urls?.packages?.quasar)
|
|
247
|
-
// .pathname
|
|
248
|
-
// },
|
|
249
|
-
// {
|
|
250
|
-
// find: 'quasar/components',
|
|
251
|
-
// replacement: new URL(
|
|
252
|
-
// 'src/components.js',
|
|
253
|
-
// urls?.packages?.quasar
|
|
254
|
-
// ).pathname
|
|
255
|
-
// },
|
|
256
|
-
// {
|
|
257
|
-
// find: 'quasar/composables',
|
|
258
|
-
// replacement: new URL(
|
|
259
|
-
// 'src/composables.js',
|
|
260
|
-
// urls?.packages?.quasar
|
|
261
|
-
// ).pathname
|
|
262
|
-
// },
|
|
263
|
-
// {
|
|
264
|
-
// find: 'quasar/directives',
|
|
265
|
-
// replacement: new URL(
|
|
266
|
-
// 'src/directives.js',
|
|
267
|
-
// urls?.packages?.quasar
|
|
268
|
-
// ).pathname
|
|
269
|
-
// },
|
|
270
198
|
{
|
|
271
199
|
find: 'quasar/src/',
|
|
272
200
|
replacement: new URL(
|
|
@@ -274,24 +202,6 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
274
202
|
config.vitrify!.urls!.packages!.quasar
|
|
275
203
|
).pathname
|
|
276
204
|
}
|
|
277
|
-
// {
|
|
278
|
-
// find: 'quasar',
|
|
279
|
-
// replacement: new URL(
|
|
280
|
-
// 'node_modules/quasar',
|
|
281
|
-
// config.vitrify?.urls?.app
|
|
282
|
-
// )
|
|
283
|
-
// }
|
|
284
|
-
// {
|
|
285
|
-
// find: new RegExp('^quasar$'),
|
|
286
|
-
// replacement: new URL('src/index.all.js', urls?.packages?.quasar)
|
|
287
|
-
// .pathname
|
|
288
|
-
// }
|
|
289
|
-
// {
|
|
290
|
-
// find: `@quasar/extras`,
|
|
291
|
-
// replacement: new URL('.', urls?.packages?.['@quasar/extras'])
|
|
292
|
-
// .pathname
|
|
293
|
-
// }
|
|
294
|
-
// { find: new RegExp('^quasar$'), replacement: 'virtual:quasar' }
|
|
295
205
|
]
|
|
296
206
|
},
|
|
297
207
|
optimizeDeps: {
|
|
@@ -300,13 +210,6 @@ export const QuasarPlugin: VitrifyPlugin = async ({
|
|
|
300
210
|
define: {
|
|
301
211
|
__DEV__: process.env.NODE_ENV !== 'production' || true,
|
|
302
212
|
__QUASAR_VERSION__: `'${version}'`
|
|
303
|
-
// __QUASAR_SSR__: !!ssr,
|
|
304
|
-
// // __QUASAR_SSR_SERVER__: ssr === 'server',
|
|
305
|
-
// __QUASAR_SSR_SERVER__: `import.meta.env.SSR`,
|
|
306
|
-
// // __QUASAR_SSR_CLIENT__: ssr === 'client',
|
|
307
|
-
// __QUASAR_SSR_CLIENT__: `!import.meta.env.SSR`,
|
|
308
|
-
// // __QUASAR_SSR_PWA__: ssr === 'client' && pwa
|
|
309
|
-
// __QUASAR_SSR_PWA__: pwa ? `!import.meta.env.SSR` : false
|
|
310
213
|
},
|
|
311
214
|
ssr: {
|
|
312
215
|
noExternal: ['quasar']
|