fix!: Add suffix to non-production output directories (#1086)

This commit is contained in:
Aaron
2024-10-19 05:23:28 -05:00
parent 0f71d570ca
commit c712175445
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -104,13 +104,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);
+2 -2
View File
@@ -63,8 +63,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;
/**