https://github.com/Shopify/bootsnap会在启动时加载所有的ruby文件。但是,我一定不需要加载特定的目录。有没有这样做的配置?或者,有没有简单的猴子补丁来实现同样的事情?
发布于 2019-06-20 16:37:15
查看gem的source,我还看不到任何从缓存中排除某些路径的配置。
但是,我认为您可以定义需要在以下文件(猴子修补)中排除的路径
Dir.glob(path + ALL_FILES).each do |absolute_path|
next if contains_bundle_path && absolute_path.start_with?(BUNDLE_PATH)
relative_path = absolute_path.slice(relative_slice)
// Here match your path with the relative path and skip the loop iteration
if File.directory?(absolute_path)
dirs << relative_path
elsif REQUIRABLE_EXTENSIONS.include?(File.extname(relative_path))
requirables << relative_path
end
end希望能有所帮助。
https://stackoverflow.com/questions/56681344
复制相似问题