static/img vs docs/assets—what's the difference? #5458
-
|
I noticed the different documentation for storing assets in Is there a major difference in how Docusaurus parses or loads assets stored in either folder? I know that files stored in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Files not in the static folder will need you to |
Beta Was this translation helpful? Give feedback.
Files not in the static folder will need you to
requirethem so they enter Webpack's bundling pipeline and get emitted. They will end up in thebuild/assets/imagesfolder and will be hashed. If you have some loader configured for Webpack, these images may also be minified / cropped, while images fromstaticare always copied as-is and you can directly use URLs to reference them withoutrequire. (In fact if yourequirean image in static directory two copies would be created, one at the build root and one as asset)