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

405
Vistas
Electron packager ignore folder contents from the root level

I am trying to use electron-packager to package an electron app. When packaging my app I want to ignore the entire contents of certain folders. Using the --ignore flag you can pass a regular expression to electron-packager to tell it to ignore matches.

My folder structure looks like

app
|--build
|--node_modules
|--src
index.html
main.js
package.json

Using the method from the accepted answer of this question I prepended my expression with ^ to restrict the pattern to the root level.

let execArgs = `npx electron-packager ./ "${productName}"`
    + ` --platform=win32`
    + ` --out=${outPath}`
    + ' --ignore=^/build';
execSync(execArgs);

However, electron-packager appears to still be ignoring more than just the specific folders. If I try running the packaged app I get the error Error: Cannot find module '../helpers/buildURL'. The full relative path of this file is ./node_modules/axios/lib/helpers/buildURL.js.

If I comment out the line ignoring the build folder, I no longer get the error above.

// + ' --ignore=^/build'

How can I make electron-packager ignore specific folders and their contents from the root level?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Looks like all I had to do was surround my argument in quotes.

+ ' --ignore="^/build"';

I'm not sure why this made a difference, since my argument does not include any spaces, but when I surrounded it in quotes the expression ignored only the correct files.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I always use this script to ignore files when I package an electron app

script{"electron-build":"electron-packager . MYAPP --ignore build/* }

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