Ember-CLI:如何从/ build中排除/ public中的文件夹

时间:2015-02-22 20:52:18

标签: ember-cli

我的Ember-CLI应用程序有几千个静态资产(~1GB),我的构建时间现在大约是30秒。 我试过我的Brocfile.js但没有成功:

var app = new EmberApp({
fingerprint: {
  enabled: false, 
  exclude: ['large_folder']
}

});

使用资产构建时间:TreeMerger | 29738ms /没有:TreeMerger | 9182ms。

如何加快构建的想法? (Ember-CLI 0.1.7)

2 个答案:

答案 0 :(得分:0)

您已启用:false,您可以将其设置为true。

另外,在排除时,最好说出文件夹的路径,例如:

如果图像中有一个大文件夹,那么你可以这样做:

fingerprint: {
  exclude: ['assets/images/large_folder/', 'assets/uploads/other_large_folder/]
}

答案 1 :(得分:0)

我自己的解决方案目前是使用postBuild-hook和一个指向assets文件夹的符号链接。

LIB /链路后构建/ index.js:

var fs = require('fs');
var path = require('path'); 

module.exports = {
  name: 'link-after-build',

  // link additional assets after build
  postBuild: function(result) {

    if (process.env.EMBER_ENV === 'development') {

      var buildDirPath = result.directory;

      var srcpath = path.resolve("/opt/local/apache2/htdocs/large_folder");
      var dstpath = path.resolve(buildDirPath + "/large_folder");
      fs.symlinkSync(srcpath,dstpath);
    }
  }

};
相关问题