Skip to content

feat: ignore elements with a vite-ignore or wxt-ignore attribute #1603

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

Merged
merged 2 commits into from
Apr 24, 2025

Conversation

Tensai75
Copy link
Contributor

Overview

This PR adds the ability for the user to use ignore attributes, either vite-ignore or wxt-ignore in html elements to make wxt ignore those elements and not process the src or href attributes.
If wxt-ignore is used as attribute, the attribute is removed. The vite-ignore attribute does not need to be removed as it is removed later by Vite.

Manual Testing

Add the attribute vite-ignore or wxt-ignore to a link element in an entrypoint html file. The href attribute should not be processed in the resulting html file and the vite-ignore or wxt-ignore should be removed.

Related Issue

N/A.
Manually ignoring elements may be beneficial in some specific edge cases like in the problem which was discussed here: #1548

Copy link

netlify bot commented Apr 22, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit e386537
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/6809cb6dee64dd0008589ed6
😎 Deploy Preview https://deploy-preview-1603--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

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

I saw your message in discord, your PRs are great! Thanks for splitting them up.

Copy link

pkg-pr-new bot commented Apr 24, 2025

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@1603

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@1603

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@1603

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@1603

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@1603

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@1603

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@1603

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@1603

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@1603

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@1603

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@1603

wxt

npm i https://pkg.pr.new/wxt@1603

commit: e386537

@aklinker1 aklinker1 merged commit 31071bd into wxt-dev:main Apr 24, 2025
16 checks passed
Copy link
Contributor

Thanks for helping make WXT better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants