Skip to content
Duncan Walker edited this page Apr 24, 2021 · 8 revisions

Previous: Usage


Options

enabled

  • Default: true
  • Type: Boolean

Whether or not the addon should be enabled regardless or whether it's installed.

outputDir

  • Default: 'assets'
  • Type: String

The directory to place asset files into.

outputFileName

  • Default: 'app'
  • Type: String

The name of the file in the outputDir directory to save concatenated files as.

useSelfClosingTags

  • Default: false
  • Type: Boolean

Whether or not to use self closing tags for <link rel="stylesheet" />.

wrapScriptsInFunction

  • Default: false
  • Type: Boolean

Whether or not to wrap the content of script files in a function.

treeTypes

  • Default: ['all']
  • Type: String[]

Asset concatenation would happen in postprocessTree hook which is in turn ran by addonPostprocessTree of EmberApp. The addons postprocessTree is ran for every tree type that normal app would generate: template, js, css and additionally it would run for trees already merged by own ember-cli pipeline (all). The treeTypes option specifies for which types of Broccoli trees asset concatenation should be ran. By default this addon properly handles trees of type all which would include js and css assets in the input folder. For any other setting (example would be template) the js and css files required by this addon, namely vendor.js/vendor.css and app-name.js/app-name.css might be not found in the addon input folder and ember-cli-concat would raise a compile Error. Generally ember-cli-concat is meant to be used with default option and apply its concatenation only to the tree of type all which would usually include vendor.js/vendor.css and app-name.js/app-name.css that are required for this addon to function properly.

concat

Extension specific (css.concat or js.concat)

  • CSS Default: false
  • JS Default: false
  • Type: Boolean

Whether or not to concatenate the app-name and vendor files into a single file at <outputDir>/<outputFileName>.<extension>.

contentFor

Extension specific (css.contentFor or js.contentFor)

  • CSS Default: 'concat-css'
  • JS Default: 'concat-js'
  • Type: String

The {{content-for}} hook in app/index.html to place the style or script tags.

footer

Extension specific (css.footer or js.footer)

  • CSS Default: null
  • JS Default: null
  • Type: String

A string to append to the start of each the concatenated file for the extension. Most likely you would use this for a comment containing copyright or owner info.

header

Extension specific (css.header or js.header)

  • CSS Default: null
  • JS Default: null
  • Type: String

A string to append to the end of each the concatenated file for the extension. Most likely you would use this for a comment containing copyright or owner info.

preserveOriginal

Extension specific (css.preserveOriginal or js.preserveOriginal)

  • CSS Default: true
  • JS Default: true
  • Type: Boolean

Whether or not to keep the original vendor and app-name file for each extension regardless of whether or not they are concatenated. This option is useful if you would like to concatenate files in a development environment but want to use the /tests route for Ember testing.

useAsync

Extension specific (js.useAsync)

  • JS Default: false
  • Type: Boolean

Whether to use <script async>.

useDefer

Extension specific (js.useDefer)

  • JS Default: false
  • Type: Boolean

Whether to use <script defer>.

preLoad

Extension specific (css.preLoad)

  • CSS Default: false
  • Type: Boolean

Whether to use <link rel="preload">.


Previous: Usage