Usage of Node process
module pulls in ~3KB shim when building
#57
Labels
bug
Something isn't working
process
module pulls in ~3KB shim when building
#57
Versions
Describe the bug
I'm using Parcel to build the JS for one of my sites. This code in the Plausible tracker:
plausible-tracker/src/lib/tracker.ts
Lines 285 to 296 in c0b87d9
Causes Parcel to pull in a ~3KB (minified) shim for the Node.js
process
module. This is the code that gets bundled: https://github.com/defunctzombie/node-process/blob/master/browser.jsThis can be avoided with the following Parcel config in
package.json
:but this shouldn't be necessary.
Expected behavior
Tracker should be as lightweight as possible and not pull in unnecessary shims. Since the code causing this issue is only for testing, it shouldn't exist at all in the production build of the library. Potentially this code could be implemented using a mock in the test, rather than modifying the library itself to perform differently under test.
Steps to reproduce
Steps:
Create
analytics.js
, for example:Run
parcel
on it, e.g.Observe the resulting
dist/analytics.js
file.Your Environment
N/A
The text was updated successfully, but these errors were encountered: