JavaScript Developer for Webpack Code Refactoring

Job ID: 39663091

Budget: $200 – $300 USD

I'm seeking an experienced JavaScript developer with expertise in Webpack, code bundling, deobfuscation, and refactoring to help untangle a complex, minified, obfuscated JS bundle from a standalone web app.

This is basically the 1st phase of a larger refactoring project.
Our goal is to untangle these components into a readable and organized file structure.

There is a single js file which needs to be worked. It contains:
1.Webpack Runtime: Bootstrap code that manages and loads modules.
2.Hot Module Replacement (HMR) Code: Logic for live-reloading during development, which is not needed in a static deployment.
3.Third-Party Libraries: Full source code for libraries like decimal.js, Math.js, Bunyan, bowser.js, ....
4.Application Code: The core logic for your cognitive tasks.


Here is what I am expecting to be done:

Step 1- Project Restructuring and Preparation
Goal: Create a clean project structure and make the bundled code readable.

In project's /js/ directory, create two new subdirectories:
- js/libs/: This will hold the standalone third-party library files.
- js/app/: This will hold the refactored application code.


Step 2- Remove the Hot Module Replacement (HMR) code.
Goal: Strip out the development-only HMR code from the application bundle.


Step 3- Externalizing Third-Party Libraries
Goal: Replace the bundled library code with links to standalone files.
This will require sourcing the original versions online and replacing the current code with those.


Step 4: Isolating Application Logic from Runtime
Goal: Separate the Webpack runtime from the application modules to make the core logic easier to manage.

- Create js/app/runtime.js
move Webpack runtime from the original js into this new file.

- Create js/app/modules.js
Move the entire module array from the original js into this file.

- Delete the original js from project. It is not needed anymore.


Step 5- Code Readability and Deobfuscation
Goal: Transform the cryptic, minified application code within js/app/modules.js into human-readable, self-documenting code by renaming variables, functions, and replacing "magic numbers" with named constants.
(suggested approach: consider creating and using a Constants File, Rename Core Module Parameters and then systematically analyze modules to give variables and functions meaningful names and replace magic numbers/strings from the constants file).


Step 6- Update Files
Goal: Update all js and HTML files to use the new, refactored script structure.


Step 7- Check things in working shape
Goal: Run and play all tests, get results and examine working behavior in detail. Make sure there are no errors and everything delivered in working condition just like the original package.


In order to take your application seriously, start your message saying "I know refactoring".
And do not apply if you don't have experience doing such thing. This is not a simple task but requires systematic approach, planning and experience.
Files available upon request.
Related categories: JavaScript Software Development Webpack