Describe the bug
dist/axios.min.js of version 0.21.2 to 0.21.4 contains its package.json which is never required for usages on browser.
Version 0.21.1 and before did not. This gave extra 2KB fat for the minified build.
To Reproduce
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.4/axios.min.js | wc -c
19157
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.2/axios.min.js | wc -c
19025
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js | wc -c
14355
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.4/axios.min.js | grep -c '"name":"axios","version":"0.21'
1
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.2/axios.min.js | grep -c '"name":"axios","version":"0.21'
1
$ curl -s https://cdnjs.cloudflare.com/ajax/libs/axios/0.21.1/axios.min.js | grep -c '"name":"axios","version":"0.21'
0
Expected behavior
Please keep dist/axios.min.js weight healthy. 💪
Environment
- Axios Version 0.21.2 to 0.21.4
Additional context/Screenshots
This happens because lib/helpers/validator.js loads package.json even for dist/axios.min.js build. @DigitalBrainJS
var pkg = require('./../../package.json');
var currentVerArr = pkg.version.split('.');
Describe the bug
dist/axios.min.jsof version 0.21.2 to 0.21.4 contains itspackage.jsonwhich is never required for usages on browser.Version 0.21.1 and before did not. This gave extra 2KB fat for the minified build.
To Reproduce
Expected behavior
Please keep
dist/axios.min.jsweight healthy. 💪Environment
Additional context/Screenshots
This happens because lib/helpers/validator.js loads
package.jsoneven fordist/axios.min.jsbuild. @DigitalBrainJSvar pkg = require('./../../package.json'); var currentVerArr = pkg.version.split('.');