Skip to content
This repository has been archived by the owner on May 29, 2022. It is now read-only.
/ klassmer Public archive

Optimize CommonJS projects for your browser and visualize dependencies.

License

Notifications You must be signed in to change notification settings

ayecue/klassmer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

klassmer v0.4.8

Build Status

Optimize CommonJS/AMD projects for your browser and visualize dependencies.

Getting Started

This plugin requires UglifyJS ~2.4.16

Install this plugin with this command:

npm install klassmer

Description

This package will merge your CommonJS project to one file to use it in frontend without any overhead. Also you can generate HTML files which show all dependencies of your project.

Changelog

Since ~0.3.0 there's also an autoloader which also loads external modules. If you don't want to add certain modules you are able to exclude them with the new excludes property.

Since ~0.3.2 klassmer automaticly detects if you have choosen a javascript file as source or a package json.

Since ~0.3.5 optimized certain finder options and loading (so it's faster). I also tried klassmer on react-bootstrap which seems to be working.

Since ~0.3.6 optimized processor for call types.

Since ~0.3.7 removed some unnecessary deps.

Since ~0.3.8 improved logic of package mapping. Merging is abit slower now since cyclic checking is more complex. In the next release I'll try to improve speed again.

Since ~0.3.9 you can select which compiler you want to use (right now there's just one for CommonJS). Also the speed of the cyclic check is now faster.

Since ~0.4.0 refactored the whole library in preperation to new possible code patterns. Added functionality to create a html file which shows all dependencies.

Since ~0.4.2 the Klass library is moved to an own npm package to keep this project smaller.

Since ~0.4.6 fixed critical wrong namespace.

Since ~0.4.7 fixed wrong main in package.

Since ~0.4.8 fixed require call transformation.

Example:

Example project: require-klass

Simple merge:

klassmer --source tmp/klass.js --output amd/merged.js

Merge with namespace:

klassmer --source tmp/klass.js --output amd/merged.js --namespace klass

Merge

Info:

klassmer-info --source tmp/klass.js --output amd/visual.html

Info

Arguments

klassmer

-f, --source

Type: String Path to main project javascript file or package json. (All other files will get loaded automaticly)

-t, --output

Type: String Path to merged output file.

-n, --namespace (optional)

Type: String Name of the output variable of your main module.

-m, --module (optional)

Type: String Wrapper for every single module.

-s, --start (optional)

Type: String Start of wrapper for whole merged project.

-e, --end (optional)

Type: String End of wrapper for whole merged project.

-w, --moduleFile (optional)

Type: String Path to file which should wrap for every single module.

-a, --startFile (optional)

Type: String Path to file which should start wrapping the whole merged project.

-z, --endFile (optional)

Type: String Path to file which should end wrapping the whole merged project.

-p, --separator (optional)

Type: String Seperator between all modules.

-x, --excludes (optional)

Type: String Ignore certain required modules.

-c, --compiler (optional)

Type: String Compiler which will go through the modules.

klassmer-info

-f, --source

Type: String Path to main project javascript file or package json. (All other files will get loaded automaticly)

-t, --output

Type: String Path to merged output file.

-x, --excludes (optional)

Type: String Ignore certain required modules.

-c, --compiler (optional)

Type: String Compiler which will go through the modules.

About

Optimize CommonJS projects for your browser and visualize dependencies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published