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

213
Views
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
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!