import-cost | import size of the package
kandi X-RAY | import-cost Summary
kandi X-RAY | import-cost Summary
This extension will display inline in the editor the size of the imported package. The extension utilizes webpack in order to detect the imported size.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of import-cost
import-cost Key Features
import-cost Examples and Code Snippets
Community Discussions
Trending Discussions on import-cost
QUESTION
I'm working on an angular project. I'm trying to reduce the bundle size, so I'm using VS Code Import Cost extension to check the weight that implies each 3rd party library (such as Lodash or RxJS) import.
Following best practices I'm changing imports from:
To:
As shown in the screenshots, specific imports seems to weight more than generic ones.
How is this possible? Is this because I didn't complete the change in all the files?
Versions:
- Angular 9
- Lodash 4
- RxJS 6
ANSWER
Answered 2020-Jun-11 at 19:54I don't know if this extension works well, but do not use specific imports. RxJS was rewritten to work well with es6 module and tree-shaking.
You can use webpack-bundle-analyzer
and source-map-explorer
to see the details of your bundle.
As for lodash
, use lodash-es
which works better with tree-shaking
QUESTION
ANSWER
Answered 2020-May-13 at 15:01if I have understood correctly, what you need is to use in your eslint extends:
extends: [
'plugin:vue/recommended',
'@vue/standard',
]
which have pretty much everything you need for a sane formatting.
Keep in mind you have to install them
My vs-code settings just have the default formatter
"vetur.format.defaultFormatter.html": "js-beautify-html",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
And nothing else - related to the matter -
I hope this helped.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install import-cost
Hit F5 to run tests in import-cost
Hit F5 to run the vscode-import-cost extension in debug mode
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page