Expose a function for plugins to check if async plugins are supported by the current compilation.

This commit is contained in:
Logan Smyth 2017-11-13 11:33:08 -08:00
parent 0e88156d0c
commit 44c2791849
2 changed files with 2 additions and 0 deletions

View File

@ -142,6 +142,7 @@ const readConfigJS = makeStrongCache((filepath, cache) => {
cache, cache,
// Expose ".env()" so people can easily get the same env that we expose using the "env" key. // Expose ".env()" so people can easily get the same env that we expose using the "env" key.
env: () => cache.using(() => getEnv()), env: () => cache.using(() => getEnv()),
async: () => false,
}); });
} else { } else {
cache.forever(); cache.forever();

View File

@ -189,6 +189,7 @@ const loadDescriptor = makeWeakCache(
const api = Object.assign(Object.create(context), { const api = Object.assign(Object.create(context), {
cache, cache,
env: () => cache.using(() => getEnv()), env: () => cache.using(() => getEnv()),
async: () => false,
}); });
try { try {