Skip to content

Conversation

j4k0xb
Copy link
Owner

@j4k0xb j4k0xb commented Jan 13, 2024

closes #6
closes #30
closes #33
closes #66
closes #68
closes #95

supersedes #31

Deploy Preview: deploy-preview-50--webcrack.netlify.app

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 13, 2024

Should also strip the __esModule property? This still got emitted currently:

Done

Also, these JSON imports and external imports weren't resolved as they should? They still emit a .js file instead of .json or inlining the import

emitting .json is now also implemented
externals are properly resolved (by ignoring) but not inlined yet

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

also, export statements aren't transformed.
they are firstly all initialized within a single VariableAssignment to undefined, then get assigned the actual value later.

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 13, 2024

thats specific to typescript: https://www.typescriptlang.org/play?module=1#code/KYDwDg9gTgLgBAG2PAhnAvHAjAbiA
this PR is mostly about fixing the webpack issues themselves but it could be implemented later

@mochaaP
Copy link

mochaaP commented Jan 13, 2024

acked

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 15, 2024

Externals are inlined now:

// 0: module.exports = require("worker_threads");
// 1: var tmp = __webpack_require__(0); ...
// 1 gets changed to:
import { MessageChannel, parentPort, Worker, workerData } from "worker_threads";

And import/export paths are properly resolved again for existing modules:
import * as json from "./1.json"; instead of import * as json from "1";

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

🤔 is anything still blocking this pr?

@j4k0xb
Copy link
Owner Author

j4k0xb commented Jan 28, 2024

yeah there are a couple issues like creating multiple conflicting import { a } from
didn't have much time recently to work on it

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

👌

@mochaaP
Copy link

mochaaP commented Jan 28, 2024

yeah there are a couple issues like creating multiple conflicting import { a } from didn't have much time recently to work on it

my few cents: generate names like import { a as a$chunkId$ } from './chunkId.js';

@youdie323323
Copy link

interestingly when enable the mangle option its cause an error 🤔

obfuscated.txt
https://github.com/j4k0xb/webcrack/assets/131268899/c30c8aa3-0b6e-4fef-af9f-6916810920e3

also it isnt unbundle files

@0xdevalias
Copy link
Contributor

FYI / for continuity:

Unpacking already works in #50 / https://deploy-preview-50--webcrack.netlify.app/
That PR unfortunately still has too many other bugs, but I could merge the new module/bundle detection from it in the meanwhile though

Originally posted by @j4k0xb in #144

The cherry picked module/bundle detection PR:

@sleeyax
Copy link

sleeyax commented Apr 30, 2025

Getting a handful of let t = require(/*webcrack:missing*/"./3806.js"); imports in a modern webpack project, would be good to have improved support for this through this PR. Thank you for the amazing work so far :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants