Skip to content

Commit

Permalink
fix: fix vue api mission in jsx file and close #1718
Browse files Browse the repository at this point in the history
  • Loading branch information
haoziqaq committed Jul 21, 2024
1 parent 9623ba4 commit 1c722aa
Show file tree
Hide file tree
Showing 5 changed files with 446 additions and 661 deletions.
Empty file modified packages/varlet-cli/lib/node/bin.js
100644 → 100755
Empty file.
9 changes: 4 additions & 5 deletions packages/varlet-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"client.d.ts",
"template",
"site",
"tsconfig.json",
"preset.cjs"
"tsconfig.json"
],
"engines": {
"node": "^14.18.0 || >=16.0.0"
Expand All @@ -38,15 +37,15 @@
"build": "rimraf ./lib && tsc"
},
"dependencies": {
"@babel/core": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@babel/core": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@varlet/icon-builder": "0.2.14",
"@varlet/release": "^0.2.5",
"@varlet/shared": "workspace:*",
"@varlet/vite-plugins": "workspace:*",
"@vitejs/plugin-vue": "5.0.4",
"@vitejs/plugin-vue-jsx": "3.1.0",
"@vue/babel-plugin-jsx": "1.2.1",
"@vue/babel-plugin-jsx": "1.2.2",
"@vue/compiler-sfc": "3.4.21",
"@vue/runtime-core": "3.4.21",
"chokidar": "^3.5.2",
Expand Down
3 changes: 0 additions & 3 deletions packages/varlet-cli/preset.cjs

This file was deleted.

4 changes: 3 additions & 1 deletion packages/varlet-cli/src/node/compiler/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { extractStyleDependencies, IMPORT_CSS_RE, IMPORT_LESS_RE, IMPORT_SCSS_RE
import { resolve, relative, extname, dirname } from 'path'
import { VarletConfig, getVarletConfig } from '../config/varlet.config.js'
import type { BabelFileResult } from '@babel/core'
import jsx from '@vue/babel-plugin-jsx'
import fse from 'fs-extra'
import esbuild from 'esbuild'

Expand Down Expand Up @@ -137,7 +138,7 @@ export async function compileScriptByBabel(script: string, file: string) {
presets: ['@babel/preset-typescript'],
plugins: [
[
'@vue/babel-plugin-jsx',
jsx,
{
enableObjectSlots: false,
},
Expand All @@ -147,6 +148,7 @@ export async function compileScriptByBabel(script: string, file: string) {

return code!
}

export async function compileScriptByEsbuild(script: string) {
const varletConfig = await getVarletConfig()

Expand Down
Loading

0 comments on commit 1c722aa

Please sign in to comment.