repl icon indicating copy to clipboard operation
repl copied to clipboard

fix(module-compiler): support more exports

Open wangcch opened this issue 8 months ago • 2 comments

from https://github.com/vuejs/repl/pull/327

Compile case:

repl link

export { default as dayjs } from 'dayjs';
export { default as dayjs2 } from 'dayjs';
export * as lodash from 'lodash-es';
export * as bo2 from './b.js'
export { a } from './b.js'
export { get, set } from 'lodash-es'

=>

import { set } from 'lodash-es';
import { get } from 'lodash-es';
import * as lodash from 'lodash-es';
import { default as dayjs2 } from 'dayjs';
import { default as dayjs } from 'dayjs';
const __module__ = __modules__["src/a.js"] = { [Symbol.toStringTag]: "Module" }

const __import_1__ = __modules__["src/b.js"]

__export__(__module__, "dayjs", () => dayjs)
__export__(__module__, "dayjs2", () => dayjs2)
__export__(__module__, "lodash", () => lodash)
__export__(__module__, "bo2", () => __import_1__)
__export__(__module__, "a", () => __import_1__.a)
__export__(__module__, "get", () => get)
__export__(__module__, "set", () => set)

wangcch avatar Mar 25 '25 15:03 wangcch

@wangcch is attempting to deploy a commit to the vuejs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Mar 25 '25 15:03 vercel[bot]

Open in Stackblitz

npm i https://pkg.pr.new/@vue/repl@328

commit: 2fd7af0

pkg-pr-new[bot] avatar Mar 25 '25 15:03 pkg-pr-new[bot]