@vixt/core 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -10
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -245,22 +245,29 @@ const app = defineVixtModule({
245
245
  meta: { name: name$2, configKey: "app" },
246
246
  defaults: defaults$1,
247
247
  setup(options, vixt) {
248
- const indexHtmlCode = generateIndexHtml(options, vixt);
249
- const mainTsCode = generateMainTs(options, vixt);
248
+ const { buildDir, rootDir } = vixt.options;
249
+ fs.outputFileSync(path.resolve(rootDir, "index.html"), `<!-- Generated by Vixt -->
250
+ <!-- This file transform from '${buildDir}/index.html' -->
251
+ `);
252
+ fs.outputFileSync(path.resolve(rootDir, "src", "main.ts"), `// Generated by Vixt
253
+ // This file transform from '${buildDir}/main.ts'
254
+ `);
250
255
  return {
251
256
  name: name$2,
252
257
  transformIndexHtml: {
253
258
  order: "pre",
254
259
  handler() {
255
- return indexHtmlCode;
260
+ const code = generateIndexHtml(options, vixt);
261
+ return code;
256
262
  }
257
263
  },
258
264
  transform: {
259
265
  order: "pre",
260
- handler(code, id) {
266
+ handler(_, id) {
261
267
  if (!id.includes("/src/main.ts"))
262
268
  return;
263
- return mainTsCode;
269
+ const code = generateMainTs(options, vixt);
270
+ return code;
264
271
  }
265
272
  }
266
273
  };
@@ -354,7 +361,6 @@ interface ImportMetaEnv {
354
361
  }
355
362
  const name = "vixt:typescript";
356
363
  const defaults = {
357
- // references: ['types/vite-env.d.ts', 'types/shims.d.ts', 'types/global-components.d.ts'],
358
364
  tsConfig: {
359
365
  extends: "@vue/tsconfig/tsconfig.dom.json",
360
366
  compilerOptions: {
@@ -375,14 +381,14 @@ const typescript = defineVixtModule({
375
381
  meta: { name, configKey: "typescript" },
376
382
  defaults,
377
383
  setup(options, vixt) {
378
- generateTsConfig(options, vixt);
379
- generateVixtDts(options, vixt);
380
- genarateShims(options, vixt);
381
- genarateGlobalComponents(options, vixt);
382
384
  return [
383
385
  {
384
386
  name,
385
387
  configResolved(config) {
388
+ generateTsConfig(options, vixt);
389
+ generateVixtDts(options, vixt);
390
+ genarateShims(options, vixt);
391
+ genarateGlobalComponents(options, vixt);
386
392
  generateEnvDts(config.env, vixt);
387
393
  }
388
394
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
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.3",
34
+ "vite": "^5.3.4",
35
35
  "vite-plugin-checker": "^0.7.1",
36
36
  "vue-tsc": "^2.0.26"
37
37
  },