File structure generated from yarn create vite
with the Typescript and React preset.
TSConfig and Yarn config are from my project's repo
The console log in App.tsx should be of a function
The console log in App.tsx is undefined
To generate a patch to replicate the confirmation that the browser
field is being resolved, simply do the following:
- Run the following
yarn patch bwip-js
- The above command should contain a line like this
You can now edit the following folder: /tmp/xfs-0ab1e518/user
- Run the following, replacing
<<patchDir>>
with the temp dir from the above logged line (i.e./tmp/xfs-0ab1e518/user
)
sed -i 's/ "browser": ".\/dist\/bwip-js.js",/ "browser": ".\/dist\/bwip-js.mjs",/g' "<<patchDir>>/package.json"
# Generates a patch and sets the resolution map entry for bwip-js to the patch
yarn patch-apply -s "<<patchDir>>"
# Install the newly resolved patch
yarn