element-plus: [Bug Report] Please provide an ESM (ES Module) that is importable directly from the browser

Element Plus version

1.1.0-beta.8

OS/Browsers version

Mac OS

Vue version

3.2.8

Reproduction Link

https://codepen.io/iamkun/pen/Tusfkr545A

Steps to reproduce

Any code

What is Expected?

Being able to do something like:

import ElementPlus from "https://unpkg.com/element-plus";

What is actually happening?

It is impossible to do

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Hi, we already finsh a first prototype version. Please reference: https://play.element-plus.org/

@rotu We just released full esm version.

https://unpkg.com/element-plus@latest/dist/index.full.mjs

@rotu Thank you, we will continue to optimize the ESM version, but our current focus may not be on ESM.

About memoize-one, because we have added a new dependency, memoize-one, which will be updated to the playground later.

Did you add import map? For more information, you can see https://github.com/element-plus/element-plus-playground .

{
  "imports": {
    "vue": "https://unpkg.com/@vue/runtime-dom@latest/dist/runtime-dom.esm-browser.js",
    "element-plus": "https://unpkg.com/element-plus@latest/es",
    "@vue/shared": "https://unpkg.com/@vue/shared@latest/dist/shared.esm-bundler.js",
    "lodash/": "https://unpkg.com/lodash-es@4/",
    "@popperjs/core": "https://unpkg.com/@popperjs/core@2/dist/esm",
    "normalize-wheel": "https://unpkg.com/@sxzz/normalize-wheel-es@0.0.2/index.js",
    "resize-observer-polyfill": "https://unpkg.com/resize-observer-polyfill@1.5/dist/ResizeObserver.es.js",
    "dayjs": "https://unpkg.com/dayjs@1/esm",
    "dayjs/": "https://unpkg.com/dayjs@1/esm/",
    "mitt": "https://unpkg.com/mitt@3/dist/mitt.mjs",
    "async-validator": "https://unpkg.com/async-validator@3/dist-web/index.js",
    "@vueuse/core": "https://unpkg.com/@vueuse/core@6.1/index.esm.js",
    "vue-demi": "https://unpkg.com/vue-demi/lib/v3/index.mjs",
    "@vueuse/shared": "https://unpkg.com/@vueuse/shared@6.1/index.esm.js"
  }
}

@rotu Fixed.

@rotu I will fix it later. There is indeed a problem with versions v1.1.0-beta.9 and v1.1.0-beta.10, so please skip these two versions and use version v1.1.0-beta.11.