Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit c28bc8e

Browse files
committed
fix: esm compactiblity
1 parent 55b5a81 commit c28bc8e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"*.d.ts"
5454
],
5555
"scripts": {
56-
"build": "rimraf dist && tsup \"src/*.ts\" --format cjs,esm --dts && esno scripts/postbuild.ts",
56+
"build": "tsup \"src/*.ts\" --format cjs,esm --clean --target esnext --dts --splitting && esno scripts/postbuild.ts",
5757
"dev": "tsup \"src/*.ts\" --watch src",
5858
"lint": "eslint \"{src,test}/**/*.ts\"",
5959
"lint:fix": "nr lint -- --fix",
@@ -74,13 +74,13 @@
7474
"defu": "^5.0.0",
7575
"htmlparser2": "^7.1.2",
7676
"magic-string": "^0.25.7",
77+
"@rollup/pluginutils": "^4.1.1",
7778
"unplugin": "^0.2.11"
7879
},
7980
"devDependencies": {
8081
"@antfu/eslint-config": "^0.9.0",
8182
"@antfu/ni": "^0.9.3",
8283
"@antfu/utils": "^0.3.0",
83-
"@rollup/pluginutils": "^4.1.1",
8484
"@types/jest": "^27.0.1",
8585
"@types/node": "^16.9.1",
8686
"@vue/composition-api": "^1.1.5",

pnpm-lock.yaml

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/transformSfcRefSugar.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { shouldTransform, transformAST } from '@vue/ref-transform'
22
import MagicString from 'magic-string'
3-
import { parse } from '@babel/parser'
4-
import { types as t } from '@babel/core'
3+
import babelParser from '@babel/parser'
4+
import babelCore from '@babel/core'
55
import type { ParsedSFC, ResolvedOptions } from '../types'
66

7+
const { types: t } = babelCore
8+
const { parse } = babelParser
9+
710
export function transformSfcRefSugar(sfc: ParsedSFC, options: ResolvedOptions) {
811
const importedHelpers = new Set<string>()
912

0 commit comments

Comments
 (0)