# Change log

# 2.0.1

Fixed duplicate module invalidation events.

Supposing you had three modules, a.js, b.js, and c.js, and this dependency tree:

If you change c.js, two module invalidation events would be emitted:

  1. Because b.js directly imports (depends on) it
  2. Because a.js directly imports (depends on) it

Now changing c.js will only emits one module invalidation event.

This means you can safely call one-time cleanup functions in the onModuleInvalidated callback.

Of course, if you re-execute a.js (e.g. import("a.js")) then it will start all over again, and you will get another module invalidation event for c.js when it changes, but still only one.

# 2.0.0

# Export changes

Changed export paths to not use /dist/, e.g.:

# FileTree changes

# Hook changes

# DevServer changes

# 1.2.0

The ignore option of .watch(...) was from when it just forwarded options to chokidar. But we usually also want to exclude files with given paths from the tree itself. So the option has been removed in favor of a new exclude option in the constructor.

And since we already keep an in-memory file tree (that's the whole point of FileTree), it turned out to be very easy to give a highly detailed report of what actually changed. So the onChange callback to .watch(...) now receives FileTreeChange[] where:

export type FileTreeChange = { path: string, change: 'add' | 'dif' | 'rem' }

Full Changelog

# 1.1.0

Removed tree.processFiles as being too trivial and restrictive.

To upgrade, replace:

const result = tree.processFiles(files => {
  // ...
})

with:

const files = Pipeline.from(tree.files)
// ...
return files.results()

(In fact, that's literally all the method originally did.)

Full Changelog