Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #157

Merged
merged 2 commits into from
Feb 3, 2023
Merged

Fix build #157

merged 2 commits into from
Feb 3, 2023

Conversation

fregante
Copy link
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:

@@ -0,0 +1 @@
before=2022-10-26 # https://github.com/refined-github/github-url-detection/pull/157
Copy link
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
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.

None yet

1 participant