Fixed generated compile error
Do not use HTML DOM if not available
Add CommonJS application type