0.1.8 ā€¢ Published 2 years ago

treeche v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Treeche šŸŒ“

What is this

Tree shakable Checker.

check your module is tree-shakable or not, in each module and reduce bundle size!!

Feature āœØ

  • typescript support
  • you can check in each file
  • you can check with the unique entrypoint
  • glob pattern support
  • pretty diagnostics report.

How to use šŸ”§

npm install treeche -D // TBD
treeche "**/*.ts" --excludes "node_modules" "**/*.test.ts"

Example šŸ“•

// this is not tree-shakable because have side-effect

const currentYear = new Date().getFullYear();

export function getCurrentYear() {
    return `Year ${currentYear}`
}
treeche "~~~"

log

šŸšØ ~/application/side_effect.ts is not tree-shakable due to the following code:

\`\`\`
const currentYear = new Date().getFullYear();
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
\`\`\`

if you fix this code such above

// this is tree-shakable because this does not have side-effect

export function getCurrentYear(currentYear: string) {
    return `Year ${currentYear}`
}

log

Congratulation šŸŽ‰ All files are tree-shakeable āœØ

command šŸ’»

kindnamedescriptionexample
argumentinputsinput files to check tree-shakable. you can use Node glob patterntreeche "src/*/.ts"
optionexcludesexcludes files to filter from inputs. you can use Node glob patterntreeche "src/*/.ts" --e "node_modules"
optionentry pointthe unique entry point to check tree-shakable. if you specify input with this, treeche will bundle so you can check tree-shakable also in node_modulestreeche --entry-point ./src/main.ts
0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago