library mode can't extract static assets
See original GitHub issueDescribe the bug
while in library mode, exec yarn build
, the static assets is inline into css file, but what i want is to remain assets alone.
Reproduction
- yarn create @vitejs/app vite-demo --template react
- replace
img
withdiv
inApp.tsx
, and removesrc
attribute
<div className="App-logo" />
- add
background-image: url(facivon.svg)
for.App-logo
classname inApp.css
.App-logo {
height: 40vmin;
pointer-events: none;
background-image: url(t.jpeg);
}
- edit
vite.config.json
import { defineConfig } from 'vite';
import path from 'path';
import reactRefresh from '@vitejs/plugin-react-refresh';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh()],
build: {
assetsInlineLimit: 0,
lib: {
entry: path.resolve(__dirname, './src/main.tsx'),
name: 'demo',
},
},
});
-
exec
yarn build
-
output
dist
├── style.css
├── vite-demo.es.js
└── vite-demo.umd.js
what i expect is that there is a favicon.svg
file in dist directory
Issue Analytics
- State:
- Created 2 years ago
- Reactions:20
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Static Asset Handling - Vite
Explicit URL Imports Assets that are not included in the internal list or in assetsInclude , can be explicitly imported as a URL...
Read more >Django cannot find static files. Need a second pair of eyes, I'm ...
If you are in DEBUG, set STATICFILES_DIRS = ("path/to/static") variable in your settings.py. It should then work only in DEBUG mode. If you...
Read more >Recover static library from executable - Unix Stack Exchange
I'd like to pull missingFunction1() and missingFunction2() out into a static library or object files so I can link against them in other ......
Read more >How to manage static files (e.g. images, JavaScript, CSS)
See the documentation for the STATICFILES_FINDERS setting for details on how staticfiles finds your files. Static file namespacing. Now we might be able...
Read more >Managing a Library | Microsoft Learn
LIB runs in this mode when you don't specify /EXTRACT (to copy an ... LIB can't accept a 32-bit OMF object that's in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any updates?
Can we have an option that enables emitting assets separately in lib mode?
Any updates on this?