Skip to content

walkerburgin/vite-plugin-legacy-worker-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-legacy-worker-repro

Repro

  • Run pnpm install to install dependencies
  • Run pnpm build && pnpm preview
  • Observe the runtime error when previewing the app in the browser:
    ReferenceError: Can't find variable: __VITE_IS_LEGACY__
    

Alternately:

  • Run pnpm install to install dependencies
  • Run pnpm build
  • Observe that the worker output file (e.g. dist/assets/worker-NmsWRLpo.js) contains a reference to __VITE_IS_LEGACY__:
    (function() {
        "use strict";
        console.log("[worker] import.meta.env", {
            BASE_URL: "/",
            MODE: "production",
            DEV: !1,
            PROD: !0,
            SSR: !1,
            LEGACY: __VITE_IS_LEGACY__
        })
    })();

About

Repro an issue with `@vitejs/plugin-legacy` and web workers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published