コード例 #1
0
module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
      babel: {
          includePolyfill: true
      }
    });

    app.import('bower_components/bootstrap/dist/js/bootstrap.js');
    app.import('bower_components/bootstrap/dist/css/bootstrap.css');
    ['eot', 'svg', 'ttf', 'woff', 'woff2'].forEach(function(file) {
        app.import('bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.' + file, {
            destDir: 'assets/fonts'
        });
    });

    app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js');
    app.import('bower_components/cookie/cookie.min.js');
    app.import('bower_components/jquery-color/jquery.color.js');
    app.import('bower_components/moment/min/moment.min.js');
    app.import('bower_components/uri.js/src/URI.min.js');
    app.import('bower_components/css-escape/css.escape.js');

    app.import('vendor/tree-mirror.js');
    app.import('vendor/modernizr.js');

    ['eot', 'svg', 'ttf', 'woff', 'woff2'].forEach(function(file) {
        app.import('bower_components/font-awesome/fonts/fontawesome-webfont.' + file, {
            destDir: 'assets/fonts'
        });
    });

    // Splash scripts
    var splashTree = concat(mergeTrees([
        new WatchedDir(app._resolveLocal('../splash_utils')),
        new UnwatchedDir(app._resolveLocal('vendor'))
    ], {
        annotation: 'TreeMerger (splash utils)'
    }), {
        inputFiles: [
            'mutation-summary.js',
            'tree-mirror.js',
            // LocalStorage Shim disabled since it doesn't work in Qt5
            // 'local-storage-shim.js',
            'z_inject_this.js'
        ],
        outputFile: 'splash_content_scripts/combined.js',
        header: '(function(){',
        footer: '})();'
    });

    return mergeTrees([
        app.toTree(),
        splashTree
    ]);
};
コード例 #2
0
module.exports = function() {
  var app = new StubApp({
    name: 'twiddle',
    sourcemaps: {
      enabled: false
    },
    minifyCSS: {
      enabled: false,
    },
    minifyJS: {
      enabled: false
    },
    trees: {
      app: new EmptyTree(),
      styles: new EmptyTree(['app.css', 'app.scss']),
      templates: new EmptyTree(),
      public: new EmptyTree()
    }
  });

  var addonTree = concat(app.addonTree(), {
    inputFiles: '**/*.js',
    outputFile: 'vendor/addons.js'
  });

  var fullTree = mergeTrees([app.appAndDependencies(), app.styles(), app.addonTree(), addonTree], { overwrite: true });

  return mergeTrees([
    concat(fullTree, {
      headerFiles: importedCssFiles,
      inputFiles: ['**/*.css'],
      outputFile: '/addon.css',
      allowNone: false,
      sourceMapConfig: { enabled: false },
      annotation: 'Concat: Addon CSS'
    }),

    new Funnel(app.otherAssets(), {
      srcDir:'assets',
      destDir:'.',
      allowEmpty:true
    }),

    concat(fullTree, {
      headerFiles: importedJsFiles.concat(app.legacyFilesToAppend || []).concat(['vendor/addons.js']),
      inputFiles: ['twiddle/**/*.js'],
      outputFile: '/addon.js',
      allowNone: true,
      sourceMapConfig: { enabled: false },
      annotation: 'Concat: Addon JS'
    })
  ]);
};