Migrate to Vite 5 and adjust configurations
This commit updates the `vite` dependency to the latest version (5.1.X) and makes necessary adjustments to accommodate deprecations and new features introduced in Vite 5.1.X. Changes include: - Modify the import statement for SVG files to use `query: '?raw'` syntax due to the deprecation of the `as: raw` option. - Update `moduleResolution` setting to `Bundler` in `tsconfig.json` to support the new TypeScript 5 option, aligning with Vite 5's migration guide for Rollup 4 compatibility without requiring file extensions on relative imports. Plugin migrations for Vite 5 support: - Bump `@modyfi/vite-plugin-yaml`, see @modyfi/vite-plugin-yaml#22. - Bump `electron-vite`, see alex8088/electron-vite#335. - Bump `vitejs/plugin-legacy`. - Bump `vitejs/vite-plugin-vue`, see vitejs/vite-plugin-vue#290.
This commit is contained in:
@@ -48,8 +48,9 @@ async function loadSvg(name: IconName, loaders: FileLoaders): Promise<string> {
|
||||
return modifiedContent;
|
||||
}
|
||||
|
||||
const RawSvgLoaders = import.meta.glob('@/presentation/assets/icons/**/*.svg', {
|
||||
as: 'raw', // This will load the SVG file content as a string.
|
||||
const RawSvgLoaders: FileLoaders = import.meta.glob<string>('@/presentation/assets/icons/**/*.svg', {
|
||||
query: '?raw',
|
||||
import: 'default',
|
||||
/*
|
||||
Using `eager: true` to preload all icons.
|
||||
Pros:
|
||||
|
||||
Reference in New Issue
Block a user