add an option to not to inline assets in library mode when format is 'es'
### Clear and concise description of the problem Currently when using library mode, all the assets (images, videos...) are inlined using base64. When those assets are big, it takes a long for vite to build, and the browser also takes a long time to parse the javascript. ### Suggested solution When the library format is 'es', we can add an option to make vite emit those files, and import those files in javascript using `new URL(import.meta.url, '...')`, e.g. ```javascript import foo from './image.png'; const bar = foo; // new URL(import.meta.url, './assets/image.2d8efhg.png') ``` ### Alternative _No response_ ### Additional context _No response_ ### Validations - [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md) - [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md). - [X] Read the [docs](https://vitejs.dev/guide). - [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Posted by hronro on Jul 31, 2021, 2:21 PM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
add an option to not to inline assets in library mode when format is 'es'
### Clear and concise description of the problem Currently when using library mode, all the assets (images, videos...) are inlined using base64. When those assets are big, it takes a long for vite to build, and the browser also takes a long time to parse the javascript. ### Suggested solution When the library format is 'es', we can add an option to make vite emit those files, and import those files in javascript using `new URL(import.meta.url, '...')`, e.g. ```javascript import foo from './image.png'; const bar = foo; // new URL(import.meta.url, './assets/image.2d8efhg.png') ``` ### Alternative _No response_ ### Additional context _No response_ ### Validations - [X] Follow our [Code of Conduct](https://github.com/vitejs/vite/blob/main/CODE_OF_CONDUCT.md) - [X] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/.github/contributing.md). - [X] Read the [docs](https://vitejs.dev/guide). - [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Comments (0)
No comments yet. Start the discussion.