Ensure scripts/styles only load when they need to