Skip to content

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

Merged
aklinker1 merged 2 commits into
wxt-dev:mainfrom
Tensai75:ignore-attributes
Apr 24, 2025
Merged

feat: ignore elements with a vite-ignore or wxt-ignore attribute#1603
aklinker1 merged 2 commits into
wxt-dev:mainfrom
Tensai75:ignore-attributes

Conversation

@Tensai75
Copy link
Copy Markdown
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

@netlify
Copy link
Copy Markdown

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
Copy Markdown
Member

@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.

@pkg-pr-new
Copy link
Copy Markdown

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
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for helping make WXT better!

@Tensai75 Tensai75 deleted the ignore-attributes branch April 27, 2025 07:12
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