gpt4 book ai didi

ember.js - EmberJS : Exclude a folder from being watched for changes

转载 作者:行者123 更新时间:2023-12-04 20:48:43 24 4
gpt4 key购买 nike

如何在 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);
};

关于ember.js - EmberJS : Exclude a folder from being watched for changes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52630646/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com