perf: only create a script context if there are scripts to preprocess