Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
Webpack JS compilation format

Good day fellow devs! I just want to ask, if you compile js in webpack, is there a way that the format in the compiled JS file will not be ordered by name?

For example, here are my files:

display

  • display1.js
  • display2.js

events

  • events.js

functions

  • functions.js

So I'll import the functions in each js files. So my main.js file looks like this:

import * as Functions from './functions/functions.js';
import * as Events from './events/events.js';
import * as DisplayOne from './display/display1.js';
import * as DIsplayTwo from './display/display2.js';

Functions.functionOne();
Functions.functionTwo();
Functions.functionThree();

Events.eventOne();
Events.eventTwo();

DisplayOne.displayOne();

DisplayTwo.displayTwo();

But when I go to the compiled main.js by the webpack, the format would be:

DisplayOne.displayOne();
DisplayTwo.displayTwo();

Events.eventOne();
Events.eventTwo();

Functions.functionOne();
Functions.functionTwo();
Functions.functionThree();

And because of that, there will be errors because there are functions that need to be called first in the displays but the compiled js filed changed it's format from file name first. Just want to know if there's anyway to change the format? Or did I understood the webpack compilation wrong? Is that normal and it should still work? Thank you so much! Sorry I tried my best explaining it lol. Have a great day ahead!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda