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

Package detail

broccoli-concat

ember-cli467.3kMIT4.2.5

Fast, good-enough concatenation with source maps.

broccoli-plugin

readme

Broccoli concatenator that generates & propagates sourcemaps

Build Status Build status

This filter is designed to be fast & good enough. It can generates source maps substantially faster than you'll get via mozilla/source-map, because it's special-cased for straight line-to-line contenation.

It discovers input sourcemaps in relative URLs, including data URIs.

Usage

const node = concat(node);

Advanced Usage

const node = concat(node, {
  outputFile: '/output.js',
  header: ";(function() {",
  headerFiles: ['loader.js'],
  inputFiles: ['**/*'],
  footerFiles: ['auto-start.js'],
  footer: "}());",
  sourceMapConfig: { enabled: true },
  allowNone: false | true // defaults to false, and will error if trying to concat but no files are found.
});

The structure of output.js will be as follows:

// - header
// - ordered content of the files in headerFiles
// - un-ordered content of files matched by inputFiles, but not in headerFiles or footerFiles
// - ordered content of the files in footerFiles
// - footer

Debug Usage

note: this is intended for debugging purposes only, and will most likely negatively affect your build performace is left enabled

Setting the environment variable CONCAT_STATS=true will result a summary of each concatention being output to process.cwd() + 'concat-stats-for/*.json'

Each file within that directory represents a different contenation, and will contain:

  • outputFile – the output file that was created
  • sizes – a summary of each input file, and the associated pre-minified pre-gziped byte size.

Want more details? like uglified or compressed sizes? (or have more ideas) go checkout: https://github.com/stefanpenner/broccoli-concat-analyser

Example:

concat-stats-for/<id>-file.json

{
  "outputFile": "path/to/output/File",
  "sizes": {
    "a.js": 5,
    "b.js": 10,
  }
}

other files:

  • concat-stats-for/<id>-file/a.js
  • concat-stats-for/<id>-file/b.js

changelog

v4.2.5 (2021-04-14)

:bug: Bug Fix

Committers: 1

4.2.4

  • upgrade broccoli-plugin

4.2.3

  • Add test for case outputFile having subpath
  • changing writeFileSync to outputFileSync

4.2.2

  • Updating fast-sourcemap-concat versions
  • Use input facade in simple stratagies as a custom fs

4.2.1

  • utilize new input/output facade

4.2.0

  • Upgrade Dependencies
  • Utilize new input/output broccoli-plugin api

4.1.0

  • upgrade broccoli-plugin (and other dependencies)

4.0.0

  • BREAKING: Drop Node 8 support

3.7.5

  • FIX: support CONCAT_STATS & allowNone at the same time

3.7.4

  • Upgrade: lodash.merge to prevent potential vulnerability (fix #141)

3.7.3

3.7.2

  • Avoid storing larger files in memory, instead always read them from disk.

3.7.1

  • Avoid creating concat stats folder when process.env.CONCAT_STATS is not set.

3.7.0

  • Enable process.env.CONCAT_STATS to be set after broccoli node construction (but before a build occurs).

3.6.0

  • Support custom path for concat stats (via process.env.CONCAT_STATS_PATH).

3.5.1

  • Revert changes to synchronously read larger files.

3.5.0

  • [PERF] Synchronously read larger files.

3.4.1

  • Remove unused code.

3.4.0

  • Test cleanup.

3.3.0

  • Upgrade to latest fast-sourcemap-concat version (^1.3.1).

3.2.0

  • [Rebuild PERF] move from broccoli-caching-writer to fs-tree-diff + patch based approach (@trentmwillis)

3.1.1

  • Fix package.json's files array to include all files in lib/.

3.1.0

  • Change base class to broccoli-plugin and make output persistent.

3.0.5

  • trailing newlines after sourcemap comments, so other concat tools that don't handle that case don't have issues
  • move fs-extra to dependencies (instead of devDependencies)

3.0.4

3.0.3

  • [FEATURE] added CONCAT_STATS env var, which enables each conat to output a summary of itself (files and sizes that where included)

3.0.2

  • only publish files that are required for tooling

3.0.1

  • [BUGFIX] ensure headerFiles / inputFiles / footerFiles are included in inputFiles passed to BCW, this prevents stale reads when only a headerFile or footerFile changed but nothing else.

3.0.0

  • inputFiles are now sorted lexicographically, this should improve stability of output ember-cli wasn't following the instructions and relied on undefined (brittle) behavior.

2.3.2

  • [REVERT] inputFiles are now sorted lexicographically, this should improve stability of output ember-cli wasn't following the instructions and relied on undefined (brittle) behavior.

2.3.1

  • remove minimatch (unused dep)

2.3.0

  • inputFiles are now sorted lexicographically, this should improve stability of output

2.2.1

  • upgrade minimatch to ^3.0.2 (security advisory)
  • code test and repo cleanup
  • upgrade fast-sourcemap-concat
  • upgrade broccoli deps

2.2.0

  • update lodash
  • inputFiles parameter default to all files

2.1.0

  • dont mutate passed-in config
  • pass sourcemmapConfig to the underlying engine

2.0.4

  • ensure concat name is relevant

2.0.3

  • move node 5 to allowed failures
  • [BUGFIX] ensure the file handle is always cleaned-up

2.0.1

  • Newer fast-sourcemap-concat for upstream bugfixes.
  • Better perf due to reduced use of stat calls.

2.0.0

  • structure of output file is now as follows:

    1. header
    2. headerFiles
    3. inputFiles
    4. footerFiles
    5. footer

    Previous, 4 and 5 where reversed. This made wrapping in an IIFE needless complex

  • headerFiles & footerFiles now explicity throw if provided a glob entry

  • any inputFiles that also exist in headerFiles and footerFiles are now dropped from inputFiles

beginning of time