Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

broccoli-source

broccolijs1.8mMIT3.0.1TypeScript support: included

Broccoli plugin for referring to source directories on the file system

broccoli-plugin

readme

Broccoli Source

Build Status Build status

Broccoli plugin for creating "source" nodes that refer to physical file system directories.

Example Usage

In Brocfile.js:

const { WatchedDir, UnwatchedDir } = require('broccoli-source');

// Refers to the ./lib directory on disk, and watches it.
const lib = new WatchedDir('lib');
// Note: this is equivalent to the deprecated plain-string syntax:
// const lib = 'lib';

// Refers to the ./bower_components/jquery directory, but does not watch it.
const jquery = new UnwatchedDir('bower_components/jquery');

Reference

new WatchedDir(directoryPath, options)

Create a Broccoli node referring to a directory on disk. The Broccoli watcher used by broccoli serve will watch the directory and all subdirectories, and trigger a rebuild whenever something changes.

  • directoryPath: A path to a directory, either absolute, or relative to the working directory (typically the directory containing Brocfile.js).

    The directory must exist, or Broccoli will abort.

  • options:

    • annotation: A human-readable description for this node.

new UnwatchedDir(directoryPath, options)

Same as WatchedDir, but the directory will not be watched.

This can be useful for performance reasons. For example, say you want to refer to a large directory hierarchy of third-party code in your Brocfile.js. Such third-party code is rarely edited in practice. Using UnwatchedDir instead of WatchedDir saves the overhead of setting up useless file system watchers.

When in doubt, use WatchedDir instead.

changelog

v3.0.1 (2021-03-11)

:bug: Bug Fix

  • #23 Avoid forcing eager calculation of error stacks. (@rwjblue)

Committers: 1

v3.0.0 (2019-07-29)

:bug: Bug Fix

  • #11 Fix typescript definitions and build process (@thoov)

:boom: Breaking Change

Committers: 1

v2.1.2 (2019-05-24)

:bug: Bug Fix

  • #9 Ensure all source nodes have resolved their paths. (@rwjblue)

Committers: 1

2.1.1 (2019-05-17)

:bug: Bug Fix

  • #7 Fixing missing files in published package (@thoov)

Committers: 1

2.1.0

  • convert the project to typescript

2.0.0

  • modernize code-base
  • drop node 4

1.1.0

  • Allow for calling __broccoliGetInfo__ without argument
  • Add missing __broccoliFeatures__ object

1.0.0

  • Initial release