Broccoli v2.1.0 Release Notes

Release Date: 2019-03-07 // about 5 years ago
  • ๐Ÿš€ This release adds support for several new features.

    ES Modules syntax

    PR: #385
    ๐Ÿ“ฆ ES modules syntax is now supported in Broccoli using the esm npm package. You're now free to use this syntax for your Brocfile.js https://github.com/broccolijs/broccoli#using-plugins-in-a-brocfilejs
    Welcome to the future!

    import merge from 'broccoli-merge-trees';export default merge(['a', 'b']);
    

    Export function

    PR: #386
    ๐Ÿ— Broccoli now supports exporting a function from the Brocfile.js, in the same way that Ember-CLI does https://github.com/broccolijs/broccoli#brocfilejs which paves the way for future enhancements to supply build parameters to the pipeline

    import merge from 'broccoli-merge-trees';export default () =\> { return merge(['a', 'b']); }
    

    Environment

    PR: #387
    0๏ธโƒฃ Broccoli now supports --environment,-e,--prod,--dev CLI arguments similar to Ember-CLI. The environment flag is passed to the Brocfile in the options hash { env: ENVIRONMENT } and defaults to development.
    ๐Ÿ— Similar to the legacy BROCCOLI_CLI environment variable, this allows a build pipeline to be altered based on the destined environment, for example by minifying files for production.

    import merge from 'broccoli-merge-trees';import uglify from 'broccoli-uglify-js';export default (options) =\> { let tree = merge(['a', 'b']); if (options.environment === 'production') { tree = uglify(tree); } return tree; }