Skip to content

Add 'host' value to compiler options

Choose a tag to compare

@matAtWork matAtWork released this 18 Aug 11:36
· 18 commits to master since this release

Permit the compiler options es6target, noRuntime, promises and engine to be defined with the value "host", in which case they are determined from the execution environment the code was compiled in (ie. the version of nodejs). This allows transpiled code to gracefully compile across node >0.10 using additional features of each platform as they are available. An addition named set of options, also called "host" is defined to use these values, allowing the directive "use nodent-host" to compile code for the current platform. The new value can also be used to set (or reset) names sets in the package.json. For example, to set "host" as the default values:

  "nodent":{
    "directive":{
      "default":{
		"es6target":"host",
		"promises":"host",
		"engine":"host",
		"noRuntime":"host"
      }
    }
  }