Skip to content

Commit

Permalink
update website
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Dec 10, 2023
1 parent dfdd154 commit 8b88da4
Show file tree
Hide file tree
Showing 4 changed files with 1,030 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,7 @@
}
</pre><p>Syntax features are specified using esbuild-specific feature names. The full set of feature names is as follows:
<p><strong>JavaScript:</strong></p> <ul> <li><code>arbitrary-module-namespace-names</code></li> <li><code>array-spread</code></li> <li><code>arrow</code></li> <li><code>async-await</code></li> <li><code>async-generator</code></li> <li><code>bigint</code></li> <li><code>class</code></li> <li><code>class-field</code></li> <li><code>class-private-accessor</code></li> <li><code>class-private-brand-check</code></li> <li><code>class-private-field</code></li> <li><code>class-private-method</code></li> <li><code>class-private-static-accessor</code></li> <li><code>class-private-static-field</code></li> <li><code>class-private-static-method</code></li> <li><code>class-static-blocks</code></li> <li><code>class-static-field</code></li> <li><code>const-and-let</code></li> <li><code>decorators</code></li> <li><code>default-argument</code></li> <li><code>destructuring</code></li> <li><code>dynamic-import</code></li> <li><code>exponent-operator</code></li> <li><code>export-star-as</code></li> <li><code>for-await</code></li> <li><code>for-of</code></li> <li><code>function-or-class-property-access</code></li> <li><code>generator</code></li> <li><code>hashbang</code></li> <li><code>import-assertions</code></li> <li><code>import-meta</code></li> <li><code>inline-script</code></li> <li><code>logical-assignment</code></li> <li><code>nested-rest-binding</code></li> <li><code>new-target</code></li> <li><code>node-colon-prefix-import</code></li> <li><code>node-colon-prefix-require</code></li> <li><code>nullish-coalescing</code></li> <li><code>object-accessors</code></li> <li><code>object-extensions</code></li> <li><code>object-rest-spread</code></li> <li><code>optional-catch-binding</code></li> <li><code>optional-chain</code></li> <li><code>regexp-dot-all-flag</code></li> <li><code>regexp-lookbehind-assertions</code></li> <li><code>regexp-match-indices</code></li> <li><code>regexp-named-capture-groups</code></li> <li><code>regexp-set-notation</code></li> <li><code>regexp-sticky-and-unicode-flags</code></li> <li><code>regexp-unicode-property-escapes</code></li> <li><code>rest-argument</code></li> <li><code>template-literal</code></li> <li><code>top-level-await</code></li> <li><code>typeof-exotic-object-is-object</code></li> <li><code>unicode-escapes</code></li> <li><code>using</code></li> </ul>
<p><strong>CSS:</strong></p> <ul> <li><code>hex-rgba</code></li> <li><code>inline-style</code></li> <li><code>inset-property</code></li> <li><code>is-pseudo-class</code></li> <li><code>modern-rgb-hsl</code></li> <li><code>nesting</code></li> <li><code>rebecca-purple</code></li> </ul></p><h3 id="target"><a class="permalink" href="#target">#</a>Target</h3><p><i>Supported by: <a href="#build">Build</a> and <a href="#transform">Transform</a></i></p><p>This sets the target environment for the generated JavaScript and/or CSS code. It tells esbuild to transform JavaScript syntax that is too new for these environments into older JavaScript syntax that will work in these environments. For example, the <code>??</code> operator was introduced in Chrome 80 so esbuild will convert it into an equivalent (but more verbose) conditional expression when targeting Chrome 79 or earlier.</p><p>Note that this is only concerned with syntax features, not APIs. It does <em>not</em> automatically add <a href="https://developer.mozilla.org/en-US/docs/Glossary/Polyfill">polyfills</a> for new APIs that are not used by these environments. You will have to explicitly import polyfills for the APIs you need (e.g. by importing <a href="https://www.npmjs.com/package/core-js"><code>core-js</code></a>). Automatic polyfill injection is outside of esbuild's scope.</p><p>Each target environment is an environment name followed by a version number. The following environment names are currently supported:</p><ul><li><code>chrome</code></li><li><code>deno</code></li><li><code>edge</code></li><li><code>firefox</code></li><li><code>hermes</code></li><li><code>ie</code></li><li><code>ios</code></li><li><code>node</code></li><li><code>opera</code></li><li><code>rhino</code></li><li><code>safari</code></li></ul><p>In addition, you can also specify JavaScript language versions such as <code>es2020</code>. The default target is <code>esnext</code> which means that by default, esbuild will assume all of the latest JavaScript and CSS features are supported. Here is an example that configures multiple target environments. You don't need to specify all of them; you can just specify the subset of target environments that your project cares about. You can also be more precise about version numbers if you'd like (e.g. <code>node12.19.0</code> instead of just <code>node12</code>):</p><div class="switcher">
<p><strong>CSS:</strong></p> <ul> <li><code>color-functions</code></li> <li><code>gradient-double-position</code></li> <li><code>gradient-interpolation</code></li> <li><code>gradient-midpoints</code></li> <li><code>hwb</code></li> <li><code>hex-rgba</code></li> <li><code>inline-style</code></li> <li><code>inset-property</code></li> <li><code>is-pseudo-class</code></li> <li><code>modern-rgb-hsl</code></li> <li><code>nesting</code></li> <li><code>rebecca-purple</code></li> </ul></p><h3 id="target"><a class="permalink" href="#target">#</a>Target</h3><p><i>Supported by: <a href="#build">Build</a> and <a href="#transform">Transform</a></i></p><p>This sets the target environment for the generated JavaScript and/or CSS code. It tells esbuild to transform JavaScript syntax that is too new for these environments into older JavaScript syntax that will work in these environments. For example, the <code>??</code> operator was introduced in Chrome 80 so esbuild will convert it into an equivalent (but more verbose) conditional expression when targeting Chrome 79 or earlier.</p><p>Note that this is only concerned with syntax features, not APIs. It does <em>not</em> automatically add <a href="https://developer.mozilla.org/en-US/docs/Glossary/Polyfill">polyfills</a> for new APIs that are not used by these environments. You will have to explicitly import polyfills for the APIs you need (e.g. by importing <a href="https://www.npmjs.com/package/core-js"><code>core-js</code></a>). Automatic polyfill injection is outside of esbuild's scope.</p><p>Each target environment is an environment name followed by a version number. The following environment names are currently supported:</p><ul><li><code>chrome</code></li><li><code>deno</code></li><li><code>edge</code></li><li><code>firefox</code></li><li><code>hermes</code></li><li><code>ie</code></li><li><code>ios</code></li><li><code>node</code></li><li><code>opera</code></li><li><code>rhino</code></li><li><code>safari</code></li></ul><p>In addition, you can also specify JavaScript language versions such as <code>es2020</code>. The default target is <code>esnext</code> which means that by default, esbuild will assume all of the latest JavaScript and CSS features are supported. Here is an example that configures multiple target environments. You don't need to specify all of them; you can just specify the subset of target environments that your project cares about. You can also be more precise about version numbers if you'd like (e.g. <code>node12.19.0</code> instead of just <code>node12</code>):</p><div class="switcher">
<a href="javascript:void 0" class="cli3">CLI</a>
<a href="javascript:void 0" class="js3">JS</a>
<a href="javascript:void 0" class="go3">Go</a>
Expand Down
Loading

0 comments on commit 8b88da4

Please sign in to comment.