Replies: 1 comment 4 replies
-
To reduce JS bundle size white source map support is very rare needed in in-browser PostCSS run |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am developing a project under Vite using VueJS 3.
The project uses
sanitize-html
, which in turn requirespostcss
. Thenpostcss
itself requiressource-map-js
but flags it as non-browser inpackage.json
:This causes Vite to generate the following warning in the browser dev console:
It originally generated similar warnings for the Node core modules
path
,url
andfs
, and I fixed that by using the packagevite-plugin-node-polyfills
.But
source-map-js
isn't a Node core module, but rather a module installed usingnpm
. So why is it flagged as non-browser?For the time being I overcame the warning by installing the older package
source-map
, and aliasingsource-map-js
tosource-map
invite.config.js
. But this feels like the wrong solution.Any advice would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions