Repository navigation
feat(config): Add outDirTemplate for customizing output directory structure - #1074
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
wxt
@wxt-dev/auto-icons
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1074 +/- ##
==========================================
- Coverage 82.16% 82.13% -0.04%
==========================================
Files 127 127
Lines 6634 6645 +11
Branches 1102 1109 +7
==========================================
+ Hits 5451 5458 +7
- Misses 1169 1173 +4
Partials 14 14 ☔ View full report in Codecov by Sentry. |
aklinker1
left a comment
There was a problem hiding this comment.
Nice, looks good. Thank you for adding tests :)
Co-authored-by: Aaron <[email protected]>
Co-authored-by: Aaron <[email protected]>
outDirTemplate for customizing output directory structure
|
Waiting for @avi12 to try this out before merging |
|
That's odd, even though the dev server has seemingly detected a change in the content script, it didn't load the updated content script // yttm-tracker.content.ts
export default defineContentScript({
matches: ["https://www.youtube.com/*"],
main() {
console.log("init yttm-tracker 1");
}
});then the CS reloads, logs "init yttm-tracker 1" // yttm-tracker.content.ts
export default defineContentScript({
matches: ["https://www.youtube.com/*"],
main() {
console.log("init yttm-tracker 2");
}
});the dev server will detect the change but after a web page reload, it will still log "init yttm-tracker 1" |
|
@avi12 Hmm, very weird. I can reproduce your problem, and DetailsThe server just quits on me after 30 seconds lol |
|
OK, that happens even without setting the |
|
Weird, just tried rerunning the dev server as |
|
I noticed content scripts didn't reload correctly when using |
|
OK, so I had to 100% quit out of Chrome when using |
|
My dev server also stopped crashing once the browser was pointing at the latest folder. Seems to be a bug in |
|
It's worth reporting the bug to web-ext then |
|
Could be fixed already, might just need to update my fork. Will look into this, but I don't think it's a blocker for this PR. Gonna merge it. |
|
I have a question: If I put |
No clue, not sure how CAC handles that. Just add a log printing |
Closes #1069
This pull request introduces a new feature to allow customization of the output directory structure using a template string. The main changes include adding a new configuration option, updating the build logic to respect this new option, and adding tests to ensure the feature works as expected.
New Feature: Customizable Output Directory Structure
packages/wxt/src/types.ts: Added a new configuration optionoutDirTemplateto theInlineConfiginterface, allowing users to define a template string for the output directory. This template can include variables such as{{browser}},{{manifestVersion}},{{mode}},{{modeSuffix}}, and{{command}}.packages/wxt/src/core/resolve-config.ts: Updated theresolveConfigfunction to process theoutDirTemplateconfiguration option. The function now replaces the template variables with their actual values to determine the output directory path.Tests
packages/wxt/e2e/tests/user-config.test.ts: Added a new test case to verify that theoutDirTemplateconfiguration is respected during the build process. The test checks that the output directory matches the expected structure based on the template.