Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite5 构建有时候出现 elemnt-plus 里的变量未定义 #19102

Open
7 tasks done
laibin-wang opened this issue Dec 30, 2024 · 2 comments
Open
7 tasks done

vite5 构建有时候出现 elemnt-plus 里的变量未定义 #19102

laibin-wang opened this issue Dec 30, 2024 · 2 comments

Comments

@laibin-wang
Copy link

Describe the bug

vite5 + elemnt-plus 2.6,有时候构建ok 有时候 构建出现elemnt-plus中table v2 种的常量定义打包到index-*.js 主文件出现变量位定义

  1. 编译正常的
    var tableV2$1 = {}, tableV2 = {}, useTable = {}, composables$1 = {}, useColumns = {}, constants$4 = {}, hasRequiredConstants$4;
    function requireConstants$4() {
    if (hasRequiredConstants$4)
    return constants$4;
    hasRequiredConstants$4 = 1,
    Object.defineProperty(constants$4, "__esModule", {
    value: !0
    });
    var e = (e => (e.ASC = "asc",
    e.DESC = "desc",
    e))(e||{})
    , t = (e => (e.CENTER = "center",
    e.RIGHT = "right",
    e))(t||{})
    , r = (e => (e.LEFT = "left",
    e.RIGHT = "right",
    e))(r||{});
    const n = {
    asc: "desc",
    desc: "asc"
    };
    return constants$4.Alignment = t,
    constants$4.FixedDir = r,
    constants$4.SortOrder = e,
    constants$4.oppositeOrderMap = n,
    constants$4.sortOrders = ["asc", "desc"],
    constants$4
    }
  2. 编译不正常的
    3var tableV2$1 = {}, tableV2 = {}, useTable = {}, composables$1 = {}, useColumns = {}, constants$4 = {}, hasRequiredConstants$4;
    function requireConstants$4() {
    if (hasRequiredConstants$4)
    return constants$4;
    hasRequiredConstants$4 = 1,
    Object.defineProperty(constants$4, "__esModule", {
    value: !0
    });
    var e = (e => (e.ASC = "asc",
    e.DESC = "desc",
    e))(e)
    , t = (e => (e.CENTER = "center",
    e.RIGHT = "right",
    e))(t)
    , r = (e => (e.LEFT = "left",
    e.RIGHT = "right",
    e))(r);
    const n = {
    asc: "desc",
    desc: "asc"
    };
    return constants$4.Alignment = t,
    constants$4.FixedDir = r,
    constants$4.SortOrder = e,
    constants$4.oppositeOrderMap = n,
    constants$4.sortOrders = ["asc", "desc"],
    constants$4
    }

Uploading image.png…

Reproduction

无法提供

Steps to reproduce

pnpm install vite build

System Info

System:
    OS: macOS 11.7.10
    CPU: (8) x64 Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz
    Memory: 1.73 GB / 20.00 GB
    Shell: 5.8 - /bin/zsh
  npmPackages:
    @commitlint/cli: ^19.5.0 => 19.5.0 
    @commitlint/config-conventional: ^19.5.0 => 19.5.0 
    @element-plus/icons-vue: ^2.3.1 => 2.3.1 
    @fullcalendar/common: ^5.11.5 => 5.11.5 
    @fullcalendar/core: ^5.11.5 => 5.11.5 
    @fullcalendar/daygrid: ^5.11.5 => 5.11.5 
    @fullcalendar/interaction: ^5.11.5 => 5.11.5 
    @fullcalendar/timegrid: ^5.11.5 => 5.11.5 
    @fullcalendar/vue3: ^5.11.5 => 5.11.5 
    @searun/base: 1.2.509 => 1.2.509 
    @searun/cms: 1.0.51 => 1.0.51 
    @searun/customform: 1.0.7 => 1.0.7 
    @searun/document: 1.0.10 => 1.0.10 
    @searun/eps-base-component: 1.0.333 => 1.0.333 
    @searun/eps-component-extend: 1.0.1 => 1.0.1 
    @searun/eps-css: 1.0.105 => 1.0.105 
    @searun/eps-system-component: 1.2.792 => 1.2.792 
    @searun/eps-system-extension: 1.0.3 => 1.0.3 
    @searun/eps-thirdparty: 1.0.4 => 1.0.4 
    @searun/eps-utils: 1.0.222 => 1.0.219 
    @searun/eslint-config: ^1.0.1 => 1.0.1 
    @searun/form-designer: 1.0.287 => 1.0.287 
    @searun/form-designer-app: 1.0.10 => 1.0.10 
    @searun/stylelint-config: ^1.0.1 => 1.0.1 
    @searun/tools: 1.0.6 => 1.0.6 
    @searun/ts-config: workspace:^1.0.0 => 1.0.0 
    @searun/vite-config: workspace:^1.0.0 => 1.0.0 
    @searun/workflow: 1.0.375 => 1.0.375 
    @searun/workflow-out: 1.0.268 => 1.0.268 
    @vitejs/plugin-vue: ^2.3.4 => 2.3.4 
    @vueuse/core: ^8.9.4 => 8.9.4 
    axios: ^1.7.7 => 1.7.7 
    commitizen: ^4.3.1 => 4.3.1 
    conventional-changelog-cli: ^5.0.0 => 5.0.0 
    cross-env: ^7.0.3 => 7.0.3 
    cz-git: ^1.10.1 => 1.10.1 
    echarts: ^5.5.1 => 5.5.1 
    echarts-liquidfill: ^3.1.0 => 3.1.0 
    echarts-wordcloud: ^2.1.0 => 2.1.0 
    element-plus: 2.6.0 => 2.6.0 
    husky: ^9.1.6 => 9.1.6 
    intro.js: ^7.2.0 => 7.2.0 
    js-base64: ^3.7.7 => 3.7.7 
    js-pinyin: ^0.2.5 => 0.2.5 
    lint-staged: ^15.2.10 => 15.2.10 
    localforage: ^1.10.0 => 1.10.0 
    lodash-es: ^4.17.21 => 4.17.21 
    mitt: ^3.0.1 => 3.0.1 
    npm-run-all2: ^6.2.0 => 6.2.0 
    nprogress: 0.2.0 => 0.2.0 
    pinia: ^2.1.7 => 2.1.7 
    postcss: ^8.4.47 => 8.4.47 
    postcss-html: ^1.7.0 => 1.7.0 
    postcss-px2rem: ^0.3.0 => 0.3.0 
    postcss-pxtorem: ^6.1.0 => 6.1.0 
    prettier: ^3.3.3 => 3.3.3 
    qiankun: ^2.10.16 => 2.10.16 
    relation-graph: ^2.2.6 => 2.2.6 
    sortablejs: ^1.15.3 => 1.15.3 
    swiper: ^9.4.1 => 9.4.1 
    terser: 5.26.0 => 5.26.0 
    tippy.js: ^6.3.7 => 6.3.7 
    turbo: ^1.12.0 => 1.12.0 
    typescript: ~5.4.0 => 5.4.2 
    uuid: ^8.3.2 => 8.3.2 
    vite: ^5.4.10 => 5.4.10 
    vite-plugin-qiankun: ^1.0.15 => 1.0.15 
    vue: ^3.5.12 => 3.5.12 
    vue-countup-v3: ^1.4.2 => 1.4.2 
    vue-grid-layout: 3.0.0-beta1 => 3.0.0-beta1 
    vue-i18n: ^10.0.4 => 10.0.4 
    vue-router: ^4.4.5 => 4.4.5 
    vue3-drr-grid-layout: ^1.9.7 => 1.9.7 
    vxe-table: ~4.6.21 => 4.6.21 
    xe-utils: ^3.5.31 => 3.5.31 

npm notice
npm notice New major version of npm available! 10.7.0 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice To update run: npm install -g npm@11.0.0
npm notice

Used Package Manager

pnpm

Logs

No response

Validations

@laibin-wang
Copy link
Author

laibin-wang commented Dec 30, 2024 via email

Copy link

Hello @laibin-wang. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction will be closed if they have no activity within 3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants