Questions tagged [file-loader]
11 questions
3
votes
1 answer
Webpack file-loader outputs empty images
I'm reaching you because I'm facing an issue in the configuration of my webpack. I just want to copy my images in /dist/images/ folder from /src/images/.
Here is my architecture :
dist
|-images
| |-lorem-picsum.png
|-pages
| |--about.html
|…

Maxime Roudier
- 139
- 7
1
vote
1 answer
How can i import pdf files dynamically into react
i am working on a react app, created using "create-react-app". i have many pdf files stored in my public folder, inside an assets folder: public/assets/file.pdf
my app has to be running locally (without web server) and i need to load these files in…

Zanni-y
- 11
- 1
1
vote
2 answers
File-Loader not reading Image files
I am getting an issue where the file-loader does not read any image files. I tried adding png to file-loader in webpack.base.config to no avail. It doesn't read any format either. Also tried updated file-loader version, didn't fix it.
EDIT: Added…

Jabba the Hutt
- 654
- 3
- 15
1
vote
0 answers
How to load images with asset/resource on server side using typescript?
I am trying to build a server side rendering app with React, Typescript and Webpack 5.
I am using asset/resource to load images on my views, at first it threw the following error while building the client:
> Cannot find module…

Diego Rodríguez
- 11
- 1
1
vote
0 answers
css-loader creates empty image file if file-loader is included in webpack config
While researching webpack, I came across an example in the official guide "Asset Management" that doesn't work as expected.
The same image is used to insert an into the DOM in a js file and as an element background in styles. When using…

lichiy
- 11
- 3
1
vote
0 answers
file-loader require returns [object Module]
I'm using "file-loader": "^6.2.0" in my Vue.js project, and I try to load PNG images from my assets directory using
When image.png is < 4KB it works as expected, but when when it's > 4KB I get a…

benams
- 4,308
- 9
- 32
- 74
0
votes
1 answer
Mixed Content Error when using threejs STLLoader to request a file from server
I am trying to load a STL file from my server on Render.com running a Flask app with Gunicorn using the threejs STLLoader but am getting the following error in browser only on some devices.
Mixed Content: The page at 'https://www.vasedjinn.com/' was…

Jules Gabriel Pare
- 18
- 5
0
votes
0 answers
I am using webpack5 with Angular13.I am facing issue in getting images from assets folder. The images are not loading from right path inside packs
The images which is by default loaded is "http://localhost:3000/packs/467c3a4a10eff4d07d15.jpg" but it should load from "http://localhost:3000/packs/media/images/cm_logo12345.jpg".I have used file-loader also but nothing is working. Any help would…

Adyasa Saniel
- 1
- 1
0
votes
0 answers
How to write options for file-loader and image-webpack-loader correctly?
I have the following configuration, but image-webpack-loader does not work in this case:
webpack.config.js
But if I record like this, I can't set the options for the file-loader:
webpack.config.js
Сould you help me solve this problem?
Tried to write…

Sergey Kamensky
- 1
- 1
0
votes
3 answers
File-loader creating 2 images and linking the wrong one
file-loader is creating two separate images in my build folder. One is the named correctly and saved in the correct path, the other is named [hash].png (which is the default) and is stored in build, not build/images. The second incorrect file is 0…

William
- 77
- 8
-1
votes
1 answer
Why file loader is important?
Why is it important to use a file loader while I can use the absolute path for my file? say image for example...
In this case, I want to use an image called img.jpg :
import myImage from "../assets/img.jpg"
function addImage(src) {
…

Karim shousha
- 31
- 4