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

feat(qwikVite): show build/[name].js output in preview with debug mode #7293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/maiieul-manual-changeset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

✨ Add the ability to see chunks names in preview/production environments to facilitate debugging of production-only bugs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To modify the configuration, you can pass an object to the `qwikVite` function.

```js
/**
* Prints verbose Qwik plugin debug logs.
* Prints verbose Qwik plugin debug logs and shows chunk file names ouput in preview/production environments.
* Default `false`
*/
debug?: boolean;
Expand Down
5 changes: 3 additions & 2 deletions packages/qwik/src/optimizer/src/plugins/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ export function normalizeRollupOutputOptionsObject(
? `${opts.assetsDir}/${assetFileNames}`
: assetFileNames;
}
// Friendly name in dev
const fileName = opts.buildMode == 'production' ? 'build/q-[hash].js' : 'build/[name].js';
// Friendly name in dev or preview with debug mode
const fileName =
opts.buildMode == 'production' && !opts.debug ? 'build/q-[hash].js' : 'build/[name].js';
// client production output
if (!outputOpts.entryFileNames) {
outputOpts.entryFileNames = useAssetsDir ? `${opts.assetsDir}/${fileName}` : fileName;
Expand Down