This PR looks to reduce the size of the @tgwf/co2 NPM package by adding code and files that are not necessary for external/production users to the .npmignore file.
The changes made are reflect those raised in #121. Namely:
Remove the IIFE code from the package that is shipped to NPM. Instead, commit this code to git for anyone who needs to use it.
Ignore the src folder. A bit controversial, but all the code can be found on GitHub. dist/cjs and dist/esm folders also ship with source maps for anyone needing to get into the code to debug.
In all, this reduces the files shipped by 41 & total package size by ~280 kB. The below diff shows the results of running the npm pack --dry-run command before and after the changes are applied. Files which have been removed from the package are highlighted.
This PR looks to reduce the size of the @tgwf/co2 NPM package by adding code and files that are not necessary for external/production users to the
.npmignore
file.The changes made are reflect those raised in #121. Namely:
dist/cjs
anddist/esm
folders. These data files are not consumed anywhere else in the code. Someone who's installing this library from NPM would access grid intensity data using the methods outlined here: https://developers.thegreenwebfoundation.org/co2js/data/#using-emissions-intensity-datasrc
folder. A bit controversial, but all the code can be found on GitHub.dist/cjs
anddist/esm
folders also ship with source maps for anyone needing to get into the code to debug.In all, this reduces the files shipped by 41 & total package size by ~280 kB. The below diff shows the results of running the
npm pack --dry-run
command before and after the changes are applied. Files which have been removed from the package are highlighted.