Used in ncc while emitting and relocating any asset references
by vercelLast 12 weeks · 0 commits
2 of 6 standards met
Some modules like node-hid use pkg-prebuilds to load their native module. Such loads are apparently not recognised by webpack-asset-relocator-loader. Would it be possible to add support for those loads? Here's an example of how the native module is loaded in node-hid: binding = require("pkg-prebuilds/bindings")(__dirname, options); The name of the module itself is provided in . Thanks!
I replaced node-pre-gyp with the latest version, shrinking the dependency graph from 95 to 56 packages. Since both the regular and coverage test modes now load the loader from source, output discrepancies between them have been eliminated. Additionally, I've added integration tests for both node-pre-gyp and node-gyp-build, using bcrypt versions 5 and 6. The split chunk logic in the test project has also been updated so that each entry point now generates its own vendor chunk. Closes #194
Repository: vercel/webpack-asset-relocator-loader. Description: Used in ncc while emitting and relocating any asset references Stars: 105, Forks: 34. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Homepage: https://npmjs.com/@vercel/webpack-asset-relocator-loader Latest release: v1.10.0 (7mo ago). Open PRs: 1, open issues: 17. Last activity: 7mo ago. Community health: 50%. Top contributors: guybedford, dependabot[bot], styfle, yjoer, Timer, yichi-yang, yurynix, adriencohen, fregante, huv1k and others.
JavaScript
Currently this library tries to recursively include all libraries in a directory when a file is detected in the same directory, which is probably fine in most cases (but not when you're trying to build a native library with Rust because its directory is included due to the files inside, which aren't needed in most cases and increase the final directory size) This notably affects Proton Pass (which has a native Rust component) by increasing the size of the final file as prepared by Electron Forge Custom emit filter has no effect here because the emitting is a consequence of the files (and they aren't passed through the filter-compatible functions either) Let me know if you need a simple test case for this Edit: #73 vaguely mentions this issue (but it doesn't seem to be a good enough bug report)
We haven't used circleci or codecov for years so we can remove these links from the readme.
Now that the dust has settled, I'm repurposing this PR to focus on simplifying the build process by removing the dependency on ncc and replacing it with a direct webpack build. This change helps resolve the cyclic dependency and avoids some of the quirks associated with ncc. The tradeoff is that we now need to maintain a small custom webpack configuration, and there's a risk that certain edge cases previously handled by ncc may not be fully covered. Building the loader with webpack passes the same set of tests as the build script. This brings us to a decision point: either continue using ncc or move forward without it. This, perhaps, provides a fallback in case ncc introduces issues again. I'm working on fixing the tests for #193. While running them, the only intermittent failure I encountered was in , where the number of lines in the webpack output is being asserted. After running the tests multiple times, I observed that the output fluctuates between 16 and 17 lines. To address this, we could update the test to allow either value. 16 lines: 17 lines: