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
events
functions
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!