Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package cleanup: reduce published files and dependencies (#126, #127) #128

Merged
merged 2 commits into from Sep 19, 2020

Conversation

thibaudcolas
Copy link
Contributor

@thibaudcolas thibaudcolas commented Sep 16, 2020

Addresses #126 and #127 in a single PR.

I don’t think there is a way to test the dependencies removal apart from npm installing the published package. For the removal of unneeded files, here is the command I would recommend using, to inspect what would be part of the package’s tarball on npm publish:

npm pack --loglevel notice 2>&1 >/dev/null | sed -e 's/^npm notice //' && rm *.tgz

And here is the diff of that command’s output before and after the switch from .npmignore to the package.json files:

📦  sass-resources-loader@2.1.0
=== Tarball Contents ===
-0     .idea/test
-0     .vscode/test
1.1kB LICENSE
1.5kB lib/utils/flattenArray.js
2.8kB lib/utils/getOptions.js
292B  lib/utils/isArrayOfStrings.js
-115B  jest.config.js
2.9kB lib/loader.js
2.3kB lib/utils/logger.js
1.0kB lib/utils/parseResources.js
1.4kB lib/utils/processResources.js
1.8kB lib/utils/rewriteImports.js
1.8kB lib/utils/rewritePaths.js
-1.6kB package.json
+1.7kB package.json
2.5kB CHANGELOG.md
-1.4kB CODE_OF_CONDUCT.md
-2.6kB CONTRIBUTING.md
9.8kB README.md
-20B   .github/FUNDING.ym
=== Tarball Details ===
[...]
-package size:  10.8 kB
+package size:  9.1 kB
-unpacked size: 35.0 kB
+unpacked size: 30.9 kB
[...]
-total files:   19
+total files:   13

Note how even if the pattern is only lib, npm will always include the project’s package.sjon, README, license, and CHANGELOG.


This change is Reviewable

@justin808
Copy link
Member

@thibaudcolas Thanks!

@justin808 justin808 merged commit d2d1c44 into shakacode:master Sep 19, 2020
@justin808
Copy link
Member

@thibaudcolas please try out v2.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants