Closed nolanlawson closed 4 years ago
Per my measurements, this PR would reduce the size of postcss-selector-parser
when bundled for the browser from 58570 bytes (58.6kB) to 49337 bytes (49.3 kB) – a reduction of 9.23kB or 15.8% smaller.
To test this, I just did a basic Webpack+Terser bulid:
npm i -g webpack-cli terser
webpack --mode production --entry ./dist/index.js --output /tmp/tmp.js && terser -mc < /tmp/tmp.js | wc -c
Thanks!
Do we need patch release?
@evilebottnawi that would be great, please!
Using the Node built-in
util
module can causes errors or warnings when using bundlers such as Rollup, since the module only exists in Node, not the browser. (This may require the use of something like rollup-plugin-node-builtins.)We only need
util
for theutil.deprecate()
function, so we can rely on util-deprecate instead, which simply wrapsutil.deprecate()
in Node as well as providing a browser-based equivalent.