Skip to content

feat: allow setting alias: false to disable default aliases#1852

Open
aleclarson wants to merge 2 commits intowxt-dev:mainfrom
still-oss:feat/disable-default-alias
Open

feat: allow setting alias: false to disable default aliases#1852
aleclarson wants to merge 2 commits intowxt-dev:mainfrom
still-oss:feat/disable-default-alias

Conversation

@aleclarson
Copy link
Contributor

I want to use my own alias patterns without interference from wxt.

@netlify
Copy link

netlify bot commented Aug 20, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 2164a95
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6969408f4100bb0008b74e75
😎 Deploy Preview https://deploy-preview-1852--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 project configuration.

@aleclarson aleclarson force-pushed the feat/disable-default-alias branch from a66539c to 004e4b1 Compare January 15, 2026 19:28
@aleclarson
Copy link
Contributor Author

I've rebased and added a test.

"strict": true,
"skipLibCheck": true,
"paths": {

Copy link
Collaborator

Choose a reason for hiding this comment

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

This blank space is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is vitest's doing. generated snapshot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or it might be project.serializeFile() actually

Copy link
Member

Choose a reason for hiding this comment

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

const text = `{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"strict": true,
"skipLibCheck": true,
"paths": {
${paths}
}
},
"include": [
"${getTsconfigPath(wxt.config.root)}/**/*",
"./wxt.d.ts"
],
"exclude": ["${getTsconfigPath(wxt.config.outBaseDir)}"]
}`;

Copy link
Collaborator

@PatrykKuniczak PatrykKuniczak Feb 11, 2026

Choose a reason for hiding this comment

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

@aklinker1 Are you want to read this file, instead of redefining it, or only i'm don't understand, what do you mean? 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if that will be fixed, it won't be in this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 11, 2026

Open in StackBlitz

@wxt-dev/analytics

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

@wxt-dev/auto-icons

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

@wxt-dev/browser

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

@wxt-dev/i18n

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

@wxt-dev/module-react

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

@wxt-dev/module-solid

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

@wxt-dev/module-svelte

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

@wxt-dev/module-vue

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

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@1852

@wxt-dev/storage

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

@wxt-dev/unocss

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

@wxt-dev/webextension-polyfill

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

wxt

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

commit: 2164a95

@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.97%. Comparing base (71308d0) to head (2164a95).
⚠️ Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1852      +/-   ##
==========================================
- Coverage   75.99%   75.97%   -0.02%     
==========================================
  Files         113      113              
  Lines        3049     3051       +2     
  Branches      686      689       +3     
==========================================
+ Hits         2317     2318       +1     
- Misses        648      649       +1     
  Partials       84       84              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
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.

@aleclarson Have you tried this by patching the changes into a real extension? I just ran the actions, you should be able to install this PR via pkg.pr.new now.

For some reason my gut is telling me WXT relies on some of these aliases internally and dev or production builds would crash, but I can't find those references in the code anymore... Maybe they were there and I've removed them naturally over time? Hmm 🤔

Once we merge this, maintainers will need to keep in mind that the default aliases will no longer always exist.

The other thing to consider is that WXT is opinionated, if you don't like it's opinions... to bad? Convention over configuration - all WXT projects use the same aliases, and other frameworks like Nuxt use them too.

Can I ask what your preferred aliases are?

@PatrykKuniczak
Copy link
Collaborator

PatrykKuniczak commented Feb 11, 2026

@aklinker1
If i'm right.
Those aliases are used not only in WXT(As lib), but only after init project on it?
If yes, anybody are able to overwrite it by passing empty object and there's no us aliases in their project, yeah??
In that case, there's no different on empty object and false, it's only syntaxis sugar(or sth on that shape), i'm right or completely no?

Don't mind

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.

3 participants