Skip to content

Commit 239dada

Browse files
committed
fix!: Add suffix to non-production output directories (#1086)
1 parent 222265f commit 239dada

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/wxt/src/core/resolve-config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ export async function resolveConfig(
104104
production: '',
105105
development: '-dev',
106106
};
107+
const modeSuffix = modeSuffixes[mode] ?? `-${mode}`;
107108
const outDirTemplate = (
108-
mergedConfig.outDirTemplate ?? `${browser}-mv${manifestVersion}`
109+
mergedConfig.outDirTemplate ??
110+
`${browser}-mv${manifestVersion}${modeSuffix}`
109111
)
110112
// Resolve all variables in the template
111113
.replaceAll('{{browser}}', browser)
112114
.replaceAll('{{manifestVersion}}', manifestVersion.toString())
113-
.replaceAll('{{modeSuffix}}', modeSuffixes[mode] ?? `-${mode}`)
115+
.replaceAll('{{modeSuffix}}', modeSuffix)
114116
.replaceAll('{{mode}}', mode)
115117
.replaceAll('{{command}}', command);
116118

packages/wxt/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export interface InlineConfig {
6363
* - <span v-pre>`{{modeSuffix}}`</span>: A suffix based on the mode ('-dev' for development, '' for production)
6464
* - <span v-pre>`{{command}}`</span>: The WXT command being run (e.g., 'build', 'serve')
6565
*
66-
* @example "{{browser}}-mv{{manifestVersion}}{{modeSuffix}}"
67-
* @default <span v-pre>`"{{browser}}-mv{{manifestVersion}}"`</span>
66+
* @example "{{browser}}-mv{{manifestVersion}}"
67+
* @default <span v-pre>`"{{browser}}-mv{{manifestVersion}}{{modeSuffix}}"`</span>
6868
*/
6969
outDirTemplate?: string;
7070
/**

0 commit comments

Comments
 (0)