karma-reference

0.0.2-1 • Public • Published

karma-reference

Karma plugin. LIghtweight dependencies tracking for js and coffee files via references.

Inspired by Cassette references

Installation

add 'reference' to karma config frameworks section

Add references

Specify references to other files at comments

for js:

// @reference <file1_path> <file2_path>

for coffee:

# @reference <file1_path> <file2_path>

Now your files would be loaded in sorted by reference dependencies order.

Note: this breaks watching of adding new files, because initial globs are resolved to filelist.

File paths

File path could be:

  • Relative path like @reference ../../dir/file.coffee.
  • Absolute path like @reference ~/dir/file.js which is resolved against karma config basePath.

TODO

  • Add tests
  • Parse only comments sections of files
  • Allow customize reference pattern by regexps in config
  • Resolve dirty hack of framework initialization (karma and node-di does not support async plugins now)

/karma-reference/

    Package Sidebar

    Install

    npm i karma-reference

    Weekly Downloads

    1

    Version

    0.0.2-1

    License

    MIT

    Last publish

    Collaborators

    • vegayours