Skip to content

Commit

Permalink
fix!: Add suffix to non-production output directories (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 authored Oct 19, 2024
1 parent 14ea7cc commit 7c51e0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/wxt/src/core/resolve-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ export async function resolveConfig(
production: '',
development: '-dev',
};
const modeSuffix = modeSuffixes[mode] ?? `-${mode}`;
const outDirTemplate = (
mergedConfig.outDirTemplate ?? `${browser}-mv${manifestVersion}`
mergedConfig.outDirTemplate ??
`${browser}-mv${manifestVersion}${modeSuffix}`
)
// Resolve all variables in the template
.replaceAll('{{browser}}', browser)
.replaceAll('{{manifestVersion}}', manifestVersion.toString())
.replaceAll('{{modeSuffix}}', modeSuffixes[mode] ?? `-${mode}`)
.replaceAll('{{modeSuffix}}', modeSuffix)
.replaceAll('{{mode}}', mode)
.replaceAll('{{command}}', command);

Expand Down
4 changes: 2 additions & 2 deletions packages/wxt/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export interface InlineConfig {
* - <span v-pre>`{{modeSuffix}}`</span>: A suffix based on the mode ('-dev' for development, '' for production)
* - <span v-pre>`{{command}}`</span>: The WXT command being run (e.g., 'build', 'serve')
*
* @example "{{browser}}-mv{{manifestVersion}}{{modeSuffix}}"
* @default <span v-pre>`"{{browser}}-mv{{manifestVersion}}"`</span>
* @example "{{browser}}-mv{{manifestVersion}}"
* @default <span v-pre>`"{{browser}}-mv{{manifestVersion}}{{modeSuffix}}"`</span>
*/
outDirTemplate?: string;
/**
Expand Down

0 comments on commit 7c51e0a

Please sign in to comment.