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

198
Vistas
How to publish js + assets files to npm

I've developed a small Ui component for internal use in a company and published it to npm but when I install that package I only get an index.js file in node_modules folder.

I'm not using any package builder, es-modules, just a straightforward .js and .css

The folder i want to publish as the package has the following structure:

package
 - src
   - index.js
   - index.css
   - assets/
     - fonts/
       - ..some fonts
     - images/
       - icon.svg
 - package.json
``
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use npm publish --dry-run to see what npm thinks it should be publishing. (Another possibility is to use npm pack and then examine the contents of the resulting tarball.)

If you have files missing, check the contents of any relevant .npmignore file or a .gitignore file, either of which might cause npm to ignore a file. (Read the relevant npm docs if you are not familiar with how that all works.)

Lastly, check your package.json to see if there is a files: entry, "which is an array of file or directory names that should be included in your package" (according to the docs previously linked). If you have a files: entry, add the files you want published that aren't being included.

about 4 years ago · Juan Pablo Isaza Denunciar
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