Stop using '$(ConfigurationType)' == 'HTMLPage' and '$(ConfigurationType)' == 'Application' since it's redundant. Instead detect the same thing from output suffix .html or .js directly, which plays better with CMake as well.