vite icon indicating copy to clipboard operation
vite copied to clipboard

plugin-legacy Unexpected token import

Open xwnwho opened this issue 1 year ago • 0 comments

Describe the bug

use <img src="@/assets/logo.png"> load static image build config legacy({ targets: ['ie >= 11', 'chrome > 49'] }) there will be new URL("logo.03d6d6da.png",import.meta.url).href in legacy chunk file. in chrome 55, import will cause error.

Reproduction

Reproduction

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 AMD Ryzen 7 4800U with Radeon Graphics
    Memory: 5.33 GB / 15.37 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.14.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.62)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitejs/plugin-legacy: ^2.0.0 => 2.0.0
    @vitejs/plugin-vue: ^3.0.1 => 3.0.1
    @vitejs/plugin-vue-jsx: ^2.0.0 => 2.0.0
    vite: ^3.0.2 => 3.0.2

Used Package Manager

pnpm

Logs

No response

Validations

xwnwho avatar Jul 22 '22 08:07 xwnwho