Skip to content

Fix build#157

Merged
fregante merged 2 commits into
mainfrom
fix-build
Feb 3, 2023
Merged

Fix build#157
fregante merged 2 commits into
mainfrom
fix-build

Conversation

@fregante
Copy link
Copy Markdown
Member

@fregante fregante commented Feb 3, 2023

Why:

  • Vite 3.2.0 produces an empty JS bundle, only in production

Bundle contents:

(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))n(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(e){if(e.ep)return;e.ep=!0;const r=i(e);fetch(e.href,r)}})();

Tried:

  • drop svelte plugin
  • only leave "console.log" in main.js

Partially undoes:

Comment thread .npmrc
@@ -0,0 +1 @@
before=2022-10-26 # https://github.com/refined-github/github-url-detection/pull/157
Copy link
Copy Markdown
Member Author

@fregante fregante Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repro

Suggested change
before=2022-10-26 # https://github.com/refined-github/github-url-detection/pull/157
before=2022-10-27
rm -rf node_modules package-lock.json 
npm install
npm run demo:build # or npm run demo:watch

Notice empty JS file in /demo/dist/assets/

@fregante fregante merged commit ee77673 into main Feb 3, 2023
@fregante fregante deleted the fix-build branch February 3, 2023 09:37
@fregante
Copy link
Copy Markdown
Member Author

fregante commented Feb 9, 2023

Opened vitejs/vite#11925

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant