Closed kiwina closed 6 years ago
i noticed that in webpack a lot of variables get renamed to module, exports, require any way around that?
Not with this package. You could potentially preprocess the bundle somehow?
Also on windows debundler fails at getModuleLocation when it checks if (!filePath.startsWith(pathPrefix)) removing the check gets the output.
Ok. Can you give me a more thorough example? I can't help you if you don't give me details.
getModuleLocation error happens with any of the tests on windows
λ debundle -i bundle.js -o dist/ -c debundle.config.json
* Reading bundle...
* Decoding modules...
* Reassembling requires...
* No lookup tabie for module 0, so using identifier as require path...
* 0 => 0
C:\Users\xxx\AppData\Local\Yarn\config\global\node_modules\debundle\src\utils\getModuleLocation.js:98
throw new Error(err);
^
once i remove the test
* Reading bundle...
* Decoding modules...
* Reassembling requires...
* No lookup tabie for module 0, so using identifier as require path...
* 0 => 0
* No lookup tabie for module 294, so using identifier as require path...
* 294 => 294
And an example of what gets renamed
function r(module) {
return module && module.__esModule ? module : { default: module };
}
Object.defineProperty(exports, '__esModule', { value: !0 });
var i = require('./125'), o = r(i);
exports.default = {
roundTo: function (module, exports) {
var require = module % exports;
return require <= exports / 2 ? module - require : module + (exports - require);
},
Ah ok, take a look at https://github.com/1egoman/debundle/blob/master/DOCS.md#replacerequires, which might help clarify (a bit) what's going on.
Closed due to inactivtiy
hi i noticed that in webpack a lot of variables get renamed to module, exports, require any way around that? Also on windows debundler fails at getModuleLocation when it checks if (!filePath.startsWith(pathPrefix)) removing the check gets the output