How can I set the language_in option for the Closure compiler?

后端 未结 1 1803
轮回少年
轮回少年 2021-02-07 04:24

I need to set the language_in option on the Closure compiler to prevent the IE8 parse error:

ERROR - Parse error. IE8 (and below) will parse trailing commas in array an

相关标签:
1条回答
  • 2021-02-07 05:04

    Run the Closure Compiler Application with the --help flag to see a description of each flag.

    java -jar compiler.jar --help
    

    CommandLineRunner defines the set of allowed values for --language_in:

    --language_in
    Sets what language spec that input sources conform.
    Options: ECMASCRIPT3, ECMASCRIPT5, ECMASCRIPT5_STRICT, ECMASCRIPT6_TYPED (experimental), ECMASCRIPT_2015, ECMASCRIPT_2016, ECMASCRIPT_2017, ECMASCRIPT_NEXT

    The LanguageMode enum has a bit more detail about these values.

    Using Closure Builder, the --language_in flag would be passed as an argument to
    --compiler_flags as in:

    --compiler_flags="--language_in=ECMASCRIPT5"
    
    0 讨论(0)
提交回复
热议问题