Skip to content

当构建库时使用 rollupOptions.output.banner 会导致打包出错误的 umd #8412

@ddosakura

Description

@ddosakura

Describe the bug

also see #8163.

I determined that this was caused by #7948 and has not been fixed in #8110.

I currently use version 2.9.5 to avoid this problem.

I also tried v3.0.0-alpha 7. It has not been fixed at present.


我也遇到了 #8163 这个问题。

我确定这是由 #7948 引入的错误的正则替换导致的,并且并未在 #8110 中得到修复。

我目前使用 2.9.5 版本来避免这个问题。

我也尝试使用了v3.0.0-alpha.7,目前并未得到修复。

Reproduction

https://github.com/ddosakura/a-bug-for-vite/blob/master/dist/mylib.umd.js

System Info

Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  npmPackages:
    vite: ^2.9.9 => 2.9.9 

or

  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  npmPackages:
    vite: ^3.0.0-alpha.7 => 3.0.0-alpha.7

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions