How to use the broccoli.loadBrocfile function in broccoli

To help you get started, we’ve selected a few broccoli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leo / cory / bin / build.js View on Github external
walker.on('end', () => {
  const timerEnd = new Date().getTime()
  const initialBuild = parseInt(timerEnd - timerStart, 10) * 1000000

  const tree = broccoli.loadBrocfile()
  const builder = new broccoli.Builder(tree)

  builder.build().then(results => {
    const dir = typeof results === 'string' ? results : results.directory
    let buildTime = results.totalTime

    // Copy files from tmp folder to the destination directory
    // And make sure to follow symlinks while doing so
    ncp(dir, config.outputDir + '/assets', {dereference: true}, err => {
      if (err) {
        throw err
      }

      if (buildTime) {
        // The original built time is in nanoseconds, so we need to convert it to milliseconds
        buildTime += initialBuild
github softlayer / sl-ember-modelize / testrunner.js View on Github external
#!/usr/bin/env node
'use strict';

process.title = 'testrunner';

var fs = require( 'fs' ),
    broccoli   = require( 'broccoli' ),
    mergeTrees = require( 'broccoli-merge-trees' ),
    filterES6Modules = require( 'broccoli-es6-module-filter' ),
    pickFiles = require( 'broccoli-static-compiler' ),
    Testem  = require( 'testem' ),
    exportTree = require( 'broccoli-export-tree' ),
    broconcat = require( 'broccoli-concat' ),
    tree = broccoli.loadBrocfile(),
    builder,
    Watcher,
    watcher,
    testem;

tree =  mergeTrees(
            [
                tree,
                broconcat(
                    mergeTrees(
                        [
                            pickFiles( 'vendor/jquery/dist', {
                                srcDir : '/',
                                files : [ 'jquery.js' ],
                                destDir : '/assets'
                            } ),
github glimmerjs / glimmer-vm / bin / build.js View on Github external
#!/usr/bin/env node

var rimraf = require('rimraf').sync;
var chalk = require('chalk');
var broccoli = require('broccoli');
var copyDereferenceSync = require('copy-dereference').sync;

process.env.BROCCOLI_ENV = process.env.BROCCOLI_ENV || 'production';
var tree = broccoli.loadBrocfile();
var builder = new broccoli.Builder(tree);

var buildPath = process.argv[2] || 'dist';

console.log('Building HTMLBars "' + process.env.BROCCOLI_ENV + '" to "' + buildPath + '/"...');

builder.build()
  .then(function(results) {
    rimraf(buildPath);
    copyDereferenceSync(results.directory, buildPath);
  })
  .then(function() {
    console.log(chalk.green('Built project successfully. Stored in "' + buildPath + '/".\n'));
  })
  .finally(function() {
    return builder.cleanup();
github ember-cli / ember-cli / lib / adapters / broccoli / server.js View on Github external
function getBuilder () {
  var tree = broccoli.loadBrocfile();
  return new broccoli.Builder(tree);
}
github ember-cli / ember-cli / lib / adapters / broccoli / build.js View on Github external
function getBuilder () {
  var tree = broccoli.loadBrocfile();
  return new broccoli.Builder(tree);
}
github muffin / cli / bin / build.js View on Github external
#!/usr/bin/env node

import broccoli from 'broccoli'
import chalk from 'chalk'
import args from 'args'
import { log, isSite } from '../lib/utils'
import Builder from '../lib/tasks/build'
import config from '../lib/config'

args.option('watch', 'Rebuild site if files change')

const options = args.parse(process.argv)
const tree = broccoli.loadBrocfile()

new Builder(tree, options.watch)
github cliqz-oss / browser-core / fern / common.js View on Github external
function getBroccoliBuilder(outputDir) {
  const brocfile = broccoli.loadBrocfile();
  return new broccoli.Builder(brocfile({}), {
    outputDir,
  });
}