@vixt/core 0.1.4 → 0.1.6
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.mjs +13 -9
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -189,7 +189,7 @@ function generateMainTs(options, vixt) {
|
|
|
189
189
|
fs.outputFileSync(path.resolve(rootDir, "src", "main.ts"), `// Generated by Vixt
|
|
190
190
|
// This file transform from '${buildDir}/main.ts'
|
|
191
191
|
`);
|
|
192
|
-
const cssTemplate = options?.css?.map((css) => `import '${css}'`).join("\n");
|
|
192
|
+
const cssTemplate = options?.css?.map((css) => `import '${css}'`).join("\n") ?? "";
|
|
193
193
|
let appComponentImportTempate = "";
|
|
194
194
|
let appConfigsImportTemplate = "";
|
|
195
195
|
let appConfigsMergeTemplate = "";
|
|
@@ -233,6 +233,7 @@ const defaults$1 = {
|
|
|
233
233
|
rootId: "app",
|
|
234
234
|
rootTag: "div",
|
|
235
235
|
baseURL: "/",
|
|
236
|
+
css: [],
|
|
236
237
|
head: {
|
|
237
238
|
meta: [
|
|
238
239
|
{ charset: "utf-8" },
|
|
@@ -245,10 +246,14 @@ const app = defineVixtModule({
|
|
|
245
246
|
meta: { name: name$2, configKey: "app" },
|
|
246
247
|
defaults: defaults$1,
|
|
247
248
|
setup(options, vixt) {
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
let indexHtmlCode;
|
|
250
|
+
let mainTsCode;
|
|
250
251
|
return {
|
|
251
252
|
name: name$2,
|
|
253
|
+
configResolved() {
|
|
254
|
+
indexHtmlCode = generateIndexHtml(options, vixt);
|
|
255
|
+
mainTsCode = generateMainTs(options, vixt);
|
|
256
|
+
},
|
|
252
257
|
transformIndexHtml: {
|
|
253
258
|
order: "pre",
|
|
254
259
|
handler() {
|
|
@@ -257,7 +262,7 @@ const app = defineVixtModule({
|
|
|
257
262
|
},
|
|
258
263
|
transform: {
|
|
259
264
|
order: "pre",
|
|
260
|
-
handler(
|
|
265
|
+
handler(_, id) {
|
|
261
266
|
if (!id.includes("/src/main.ts"))
|
|
262
267
|
return;
|
|
263
268
|
return mainTsCode;
|
|
@@ -354,7 +359,6 @@ interface ImportMetaEnv {
|
|
|
354
359
|
}
|
|
355
360
|
const name = "vixt:typescript";
|
|
356
361
|
const defaults = {
|
|
357
|
-
// references: ['types/vite-env.d.ts', 'types/shims.d.ts', 'types/global-components.d.ts'],
|
|
358
362
|
tsConfig: {
|
|
359
363
|
extends: "@vue/tsconfig/tsconfig.dom.json",
|
|
360
364
|
compilerOptions: {
|
|
@@ -375,14 +379,14 @@ const typescript = defineVixtModule({
|
|
|
375
379
|
meta: { name, configKey: "typescript" },
|
|
376
380
|
defaults,
|
|
377
381
|
setup(options, vixt) {
|
|
378
|
-
generateTsConfig(options, vixt);
|
|
379
|
-
generateVixtDts(options, vixt);
|
|
380
|
-
genarateShims(options, vixt);
|
|
381
|
-
genarateGlobalComponents(options, vixt);
|
|
382
382
|
return [
|
|
383
383
|
{
|
|
384
384
|
name,
|
|
385
385
|
configResolved(config) {
|
|
386
|
+
generateTsConfig(options, vixt);
|
|
387
|
+
generateVixtDts(options, vixt);
|
|
388
|
+
genarateShims(options, vixt);
|
|
389
|
+
genarateGlobalComponents(options, vixt);
|
|
386
390
|
generateEnvDts(config.env, vixt);
|
|
387
391
|
}
|
|
388
392
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"pathe": "^1.1.2",
|
|
32
32
|
"pkg-types": "^1.1.3",
|
|
33
33
|
"tsx": "^4.16.2",
|
|
34
|
-
"vite": "^5.3.
|
|
34
|
+
"vite": "^5.3.4",
|
|
35
35
|
"vite-plugin-checker": "^0.7.1",
|
|
36
36
|
"vue-tsc": "^2.0.26"
|
|
37
37
|
},
|