versacompiler 2.3.0 → 2.3.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.
@@ -207,6 +207,7 @@ export const minifyJS = async (data, filename, isProd = true) => {
207
207
  const options = {
208
208
  compress: {
209
209
  target: 'es2020',
210
+ unused: true,
210
211
  },
211
212
  mangle: {
212
213
  toplevel: true,
@@ -47,8 +47,10 @@ class VueHMRInjectionCache {
47
47
  // Generar nueva inyección HMR
48
48
  const vueImportPattern = /import\s*\{[^}]*\bref\b[^}]*\}\s*from\s*['"]vue['"]/;
49
49
  const hasRefImport = vueImportPattern.test(originalData);
50
+ // ✨ FIX: Construir el import dinámicamente para evitar que el compilador lo transforme
51
+ const vueRefImport = ['import', '{ ref }', 'from', '"vue"'].join(' ') + ';';
50
52
  const varContent = `
51
- ${hasRefImport ? '' : 'import { ref } from "/node_modules/vue/dist/vue.esm-browser.js";'}
53
+ ${hasRefImport ? '' : vueRefImport}
52
54
  const versaComponentKey = ref(0);
53
55
  `;
54
56
  let injectedData;
@@ -249,7 +251,7 @@ export const preCompileVue = async (data, source, isProd = false) => {
249
251
  hoistStatic: isProd,
250
252
  cacheHandlers: isProd,
251
253
  runtimeGlobalName: 'Vue',
252
- runtimeModuleName: '/node_modules/vue/dist/vue.esm-browser.js',
254
+ runtimeModuleName: 'vue',
253
255
  whitespace: 'condense',
254
256
  ssr: false,
255
257
  comments: !isProd, // ✨ Eliminar comentarios HTML del template
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "versacompiler",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Una herramienta para compilar y minificar archivos .vue, .js y .ts para proyectos de Vue 3 con soporte para TypeScript.",
5
5
  "main": "dist/main.js",
6
6
  "bin": {
@@ -18,7 +18,8 @@
18
18
  "scripts": {
19
19
  "dev": "tsx --watch src/main.ts --watch --verbose --tailwind",
20
20
  "file": "tsx src/main.ts ",
21
- "compile": "tsx src/main.ts --all --cc --co -y --verbose --prod",
21
+ "compile": "tsx src/main.ts --all --cc -y --verbose --prod",
22
+ "compileDev": "tsx src/main.ts --all --cc -y --verbose",
22
23
  "test": "vitest run",
23
24
  "test:watch": "vitest",
24
25
  "test:ui": "vitest --ui",
@@ -47,17 +48,17 @@
47
48
  },
48
49
  "homepage": "https://github.com/kriollo/versaCompiler#readme",
49
50
  "dependencies": {
50
- "@vue/compiler-dom": "^3.5.24",
51
- "@vue/reactivity": "^3.5.24",
52
- "@vue/runtime-core": "^3.5.24",
53
- "@vue/runtime-dom": "^3.5.24",
51
+ "@vue/compiler-dom": "^3.5.26",
52
+ "@vue/reactivity": "^3.5.26",
53
+ "@vue/runtime-core": "^3.5.26",
54
+ "@vue/runtime-dom": "^3.5.26",
54
55
  "browser-sync": "^3.0.4",
55
56
  "chalk": "5.6.2",
56
57
  "chokidar": "^5.0.0",
57
- "enhanced-resolve": "^5.18.3",
58
- "execa": "^9.6.0",
58
+ "enhanced-resolve": "^5.18.4",
59
+ "execa": "^9.6.1",
59
60
  "find-root": "^1.1.0",
60
- "fs-extra": "^11.3.2",
61
+ "fs-extra": "^11.3.3",
61
62
  "get-port": "^7.1.0",
62
63
  "minify-html-literals": "^1.3.5",
63
64
  "minimatch": "^10.1.1",
@@ -65,43 +66,43 @@
65
66
  "oxc-parser": "^0.108.0",
66
67
  "oxc-transform": "^0.108.0",
67
68
  "resolve": "^1.22.11",
68
- "tsx": "^4.20.6",
69
+ "tsx": "^4.21.0",
69
70
  "typescript": "^5.9.3",
70
71
  "vue": "3.5.26",
71
72
  "yargs": "^18.0.0"
72
73
  },
73
74
  "devDependencies": {
74
- "@eslint/eslintrc": "^3.3.1",
75
- "@tailwindcss/cli": "^4.1.17",
75
+ "@eslint/eslintrc": "^3.3.3",
76
+ "@tailwindcss/cli": "^4.1.18",
76
77
  "@types/browser-sync": "^2.29.1",
77
78
  "@types/find-root": "^1.1.4",
78
79
  "@types/fs-extra": "^11.0.4",
79
80
  "@types/jest": "^30.0.0",
80
81
  "@types/mocha": "^10.0.10",
81
- "@types/node": "^25.0.8",
82
+ "@types/node": "^25.0.9",
82
83
  "@types/resolve": "^1.20.6",
83
84
  "@types/yargs": "^17.0.35",
84
- "@typescript-eslint/eslint-plugin": "^8.46.4",
85
- "@typescript-eslint/parser": "^8.46.4",
86
- "@vitest/coverage-v8": "^4.0.9",
87
- "@vitest/ui": "^4.0.9",
85
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
86
+ "@typescript-eslint/parser": "^8.53.0",
87
+ "@vitest/coverage-v8": "^4.0.17",
88
+ "@vitest/ui": "^4.0.17",
88
89
  "@vue/eslint-config-typescript": "^14.6.0",
89
90
  "@vue/test-utils": "^2.4.6",
90
91
  "code-tag": "^1.2.0",
91
- "eslint": "^9.39.1",
92
+ "eslint": "^9.39.2",
92
93
  "eslint-import-resolver-typescript": "^4.4.4",
93
94
  "eslint-plugin-import": "^2.32.0",
94
- "eslint-plugin-oxlint": "^1.28.0",
95
+ "eslint-plugin-oxlint": "^1.39.0",
95
96
  "eslint-plugin-promise": "^7.2.1",
96
97
  "eslint-plugin-unicorn": "^62.0.0",
97
- "eslint-plugin-vue": "^10.5.1",
98
- "oxlint": "^1.28.0",
98
+ "eslint-plugin-vue": "^10.6.2",
99
+ "oxlint": "^1.39.0",
99
100
  "pinia": "^3.0.4",
100
101
  "prettier": "3.8.0",
101
- "rimraf": "^6.1.0",
102
- "sweetalert2": "^11.26.3",
103
- "tailwindcss": "^4.1.17",
104
- "vitest": "^4.0.9",
102
+ "rimraf": "^6.1.2",
103
+ "sweetalert2": "^11.26.17",
104
+ "tailwindcss": "^4.1.18",
105
+ "vitest": "^4.0.17",
105
106
  "vue-eslint-parser": "^10.2.0",
106
107
  "vue-router": "^4.6.4"
107
108
  },