Skip to content

Commit

Permalink
chore: update unplugin-config (#3120)
Browse files Browse the repository at this point in the history
* chore: update `unplugin-config`

* fix: decode HTML entities in the injected HTML code
  • Loading branch information
kirklin committed Oct 10, 2023
1 parent c5a13dc commit a768b7d
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 29 deletions.
2 changes: 1 addition & 1 deletion internal/vite-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"rollup-plugin-visualizer": "^5.9.2",
"sass": "^1.63.6",
"unocss": "^0.53.4",
"unplugin-config": "^0.0.13",
"unplugin-config": "^0.1.3",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-dts": "^3.1.0",
"vite-plugin-html": "^3.2.0",
Expand Down
15 changes: 11 additions & 4 deletions internal/vite-config/src/plugins/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ export async function createConfigPluginConfig(
const APP_NAME = strToHex(config?.VITE_GLOB_APP_TITLE ?? '__APP');
// https://github.com/kirklin/unplugin-config
return GenerateConfig({
disabledConfig: !shouldGenerateConfig,
globConfigFileName: GLOBAL_CONFIG_FILE_NAME,
outputDir: OUTPUT_DIR,
appName: APP_NAME,
envConfigPrefix: 'VITE_GLOB_',
envVariables: {
prefix: 'VITE_GLOB_',
},
configFile: {
generate: shouldGenerateConfig,
fileName: GLOBAL_CONFIG_FILE_NAME,
outputDir: OUTPUT_DIR,
},
htmlInjection: {
decodeEntities: true,
},
});
}
Loading

0 comments on commit a768b7d

Please sign in to comment.