Skip to content

Commit

Permalink
fix: provide correct devMode flag to theme-generator with Vite
Browse files Browse the repository at this point in the history
devMode flag was hard-coded to false in theme options, preventing the theme generator
plugin to work correctly when styles.css does not exist

Fixes #14228
  • Loading branch information
mcollovati committed Jul 28, 2022
1 parent 42f14cb commit aa4c495
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flow-server/src/main/resources/vite.generated.ts
Expand Up @@ -325,10 +325,11 @@ export { ${exports.map((binding) => `${binding} as ${binding}`).join(', ')} };`;
}

function themePlugin(opts): PluginOption {
const fullThemeOptions = {...themeOptions, devMode: opts.devMode };
return {
name: 'vaadin:theme',
config() {
processThemeResources(themeOptions, console);
processThemeResources(fullThemeOptions, console);
},
handleHotUpdate(context) {
const contextPath = path.resolve(context.file);
Expand All @@ -339,7 +340,7 @@ function themePlugin(opts): PluginOption {
console.debug('Theme file changed', changed);

if (changed.startsWith(settings.themeName)) {
processThemeResources(themeOptions, console);
processThemeResources(fullThemeOptions, console);
}
}
},
Expand Down

0 comments on commit aa4c495

Please sign in to comment.