mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
fix(es): Init filesystem cache only if plugin exists (#7436)
This commit is contained in:
parent
552bc0ba18
commit
786cf3a10f
@ -666,16 +666,16 @@ impl Options {
|
||||
{
|
||||
use swc_ecma_loader::resolve::Resolve;
|
||||
|
||||
// Currently swc enables filesystemcache by default on Embedded runtime plugin
|
||||
// target.
|
||||
init_plugin_module_cache_once(true, &experimental.cache_root);
|
||||
|
||||
let plugin_resolver = CachingResolver::new(
|
||||
40,
|
||||
NodeModulesResolver::new(TargetEnv::Node, Default::default(), true),
|
||||
);
|
||||
|
||||
if let Some(plugins) = &experimental.plugins {
|
||||
// Currently swc enables filesystemcache by default on Embedded runtime plugin
|
||||
// target.
|
||||
init_plugin_module_cache_once(true, &experimental.cache_root);
|
||||
|
||||
// Populate cache to the plugin modules if not loaded
|
||||
for plugin_config in plugins.iter() {
|
||||
let plugin_name = &plugin_config.0;
|
||||
|
Loading…
Reference in New Issue
Block a user