This extension will display inline in the editor the size of the imported package.
The extension utilizes webpack with babili-webpack-plugin in order to detect the imported size.
Calculates the size of imports and requires. Currently supports:
- Default importing:
import Func from 'utils';
- Entire content importing:
import * as Utils from 'utils';
- Selective importing:
import {Func} from 'utils';
- Selective importing with alias:
import {orig as alias} from 'utils';
- Submodule importing:
import Func from 'utils/Func';
- Require:
const Func = require('utils').Func;
- Supports both
Javascript
andTypescript
The following properties are configurable:
// Upper size limit, in KB, that will count a package as a small package
"importCost.smallPackageSize": 50,
// Upper size limit, in KB, that will count a package as a medium package
"importCost.mediumPackageSize": 100,
// Decoration color for small packages
"importCost.smallPackageColor": "#7cc36e",
// Decoration color for medium packages
"importCost.mediumPackageColor": "#7cc36e",
// Decoration color for large packages
"importCost.largePackageColor": "#d44e40",
// File extensions to be parsed by the Typescript parser
"importCost.typescriptExtensions": [
"\\.tsx?$"
],
// File extensions to be parsed by the Javascript parser
"importCost.javascriptExtensions": [
"\\.jsx?$"
]
Any package size above the mediumPackageSize limit will be considered large.
- Importing two libraries with a common dependency will show the size of both libraries isolated from each other, even if the common library needs to be imported only once.
Add a way to configure the file extensions that will be parsed
Bug fix for a small webpack issue with node
Add the ability to configure different colored decocrations for different sized packages.
Bug fix for scoped packages (i.e. @angular/router)
reworked import reconstruction a bit in order to support import React, {Component} from 'react';
Bug fix for Typescript on Windows
Bug fix for disappearing decorators on incorrect syntax
Bug fixes and prettifying output
Fix typo
Fix cache location
Add back cross-session cache with support for library version
Update readme
- Calculate cost as-you-type
- Support multiple windows
- Remove the .importcost folder
- Add support for monorepo
- Calculations are done in parallel
- Temporarily remove cross-session cache
- Bug fixes
Fix cache bug
Switch from uglifyjs-webpack-plugin to babili-webpack-plugin
Display calculation results as they arrive
Update font theme
Add cross session cache
Initial release