[英]EmberJS: Exclude a folder from being watched for changes
如何在Ember CLI中排除特定文件夹的监视?
这是我的ember-cli-build.js
文件,其中包含必要的更改以取消监视“public”目录。
const EmberApp = require('ember-cli/lib/broccoli/ember-app'),
ENV = require('./config/environment')(process.env.EMBER_ENV),
Funnel = require('broccoli-funnel'),
dependencies = require('./config/dependencies'),
UnwatchedDir = require('broccoli-source').UnwatchedDir;
module.exports = function (defaults) {
const app = new EmberApp(defaults, ENV.options),
imports = dependencies.imports;
for (let i = 0; i < imports.length; i++) {
app.import(imports[i]);
}
const compilationAssets = [],
funnels = dependencies.funnels;
Object.keys(funnels).forEach(function (key) {
const options = funnels[key],
funnelObj = new Funnel(key, options);
compilationAssets.push(funnelObj);
});
// This does the magic
if (process.env.EMBER_ENV === 'development' || process.env.EMBER_ENV == 'test') {
app.trees.public = new UnwatchedDir('public');
}
return app.toTree(compilationAssets);
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.