Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda