Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
Create json of all files in a directory using Webpack

I have the following directory structure:

.
├── assets
│   └── sprite1.png
│   └── sprite2.png
│   └── sprite3.png
├── dist
│   ├── bundle.js
│   └── index.html
├── src
│   └── main.ts
├── tsconfig.json
└── webpack.config.js

I am wanting to to generate a manifest.json file in dist/ on build that will look something like this:

{
    "sprite1": "../assets/sprite1.png",
    "sprite2": "../assets/sprite2.png",
    "sprite3": "../assets/sprite3.png"
}

I want to do this by using webpack to scan all the file paths in assets/, so that all I have to do is drag-and-drop .png files in assets/ and they will automatically be written to the manifest, which other parts of my app will use to load in assets.

Is this possible? Is there a better way to do it than using webpack?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!