Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets inline does not work version 4.3.9 #13691

Closed
7 tasks done
idanaim opened this issue Jun 30, 2023 · 3 comments
Closed
7 tasks done

Assets inline does not work version 4.3.9 #13691

idanaim opened this issue Jun 30, 2023 · 3 comments
Labels
invalid This doesn't seem right

Comments

@idanaim
Copy link

idanaim commented Jun 30, 2023

Describe the bug

I create a new project with "vite create" cli, and I saw that vitejs icon weight 1.5k (located in public folder).
I build the project and expected that the icon will be inline in base64.
instead its on the dist folder.
image

Reproduction

npm create vite@latest

Steps to reproduce

npm create vite@latest

npm run build

System Info

System:
    OS: macOS 13.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 108.63 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  npmPackages:
    @types/react: ^18.0.37 => 18.2.14 
    @types/react-dom: ^18.0.11 => 18.2.6 
    @typescript-eslint/eslint-plugin: ^5.59.0 => 5.60.1 
    @typescript-eslint/parser: ^5.59.0 => 5.60.1 
    @vitejs/plugin-react: ^4.0.0 => 4.0.1 
    eslint: ^8.38.0 => 8.43.0 
    eslint-plugin-react-hooks: ^4.6.0 => 4.6.0 
    eslint-plugin-react-refresh: ^0.3.4 => 0.3.5 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: ^5.0.2 => 5.1.6 
    vite: ^4.3.9 => 4.3.9

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

This is expected. Public directory is a feature for that.
https://vitejs.dev/guide/assets.html#the-public-directory

@sapphi-red sapphi-red added invalid This doesn't seem right and removed pending triage labels Jul 1, 2023
@idanaim
Copy link
Author

idanaim commented Jul 3, 2023

I moved them to src/assets and still it doesn't inline the svg files. am I missing something?
image
image
image

@patak-dev
Copy link
Member

Vite currently doesn't inline SVG files, you can track the resolution of this issue here:

@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants