Skip to content

Commit

Permalink
build(plugin-vite): allow renderer name to contain dashes (#3794)
Browse files Browse the repository at this point in the history
* build(plugin-vite): allow renderer name to contain dashes

* PR Feedback: formtatting
  • Loading branch information
broose-goose authored Jan 2, 2025
1 parent 34c33fa commit 2199fce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/plugin/vite/src/config/vite.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ export function getBuildConfig(env: ConfigEnv<'build'>): UserConfig {
export function getDefineKeys(names: string[]) {
const define: { [name: string]: VitePluginRuntimeKeys } = {};

// change name from kebab case to upper snake case to agree with vite:define plugin
// this allows the VitePluginRendererConfig entries to contain names with dashes

return names.reduce((acc, name) => {
const NAME = name.toUpperCase();
const NAME = name.toUpperCase().replaceAll('-', '_');
const keys: VitePluginRuntimeKeys = {
VITE_DEV_SERVER_URL: `${NAME}_VITE_DEV_SERVER_URL`,
VITE_NAME: `${NAME}_VITE_NAME`,
Expand Down

0 comments on commit 2199fce

Please sign in to comment.