mirror of
https://github.com/status-im/metro.git
synced 2025-01-27 11:24:45 +00:00
update website [ci skip]
This commit is contained in:
parent
0742622f93
commit
7b97c44ee5
@ -38,7 +38,7 @@ module<span class="token punctuation">.</span>exports<span class="token punctuat
|
|||||||
<span class="token keyword">const</span> ast <span class="token operator">=</span> babylon<span class="token punctuation">.</span><span class="token function">parse</span><span class="token punctuation">(</span>code<span class="token punctuation">,</span> <span class="token punctuation">{</span>sourceType<span class="token punctuation">:</span> <span class="token string">'module'</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
<span class="token keyword">const</span> ast <span class="token operator">=</span> babylon<span class="token punctuation">.</span><span class="token function">parse</span><span class="token punctuation">(</span>code<span class="token punctuation">,</span> <span class="token punctuation">{</span>sourceType<span class="token punctuation">:</span> <span class="token string">'module'</span><span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||||
|
|
||||||
<span class="token keyword">return</span> <span class="token punctuation">{</span>ast<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
<span class="token keyword">return</span> <span class="token punctuation">{</span>ast<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||||
<span class="token punctuation">}</span><span class="token punctuation">;</span></pre><p>If you would like to plug-in babel, you can simply do that by passing the code to it:</p><pre class="prism language-js"><span class="token keyword">const</span> <span class="token punctuation">{</span>transform<span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'@babel/core'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
<span class="token punctuation">}</span><span class="token punctuation">;</span></pre><p>If you would like to plug-in babel, you can simply do that by passing the code to it:</p><pre class="prism language-js"><span class="token keyword">const</span> <span class="token punctuation">{</span>transformSync<span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'@babel/core'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||||
|
|
||||||
module<span class="token punctuation">.</span>exports<span class="token punctuation">.</span>transform <span class="token operator">=</span> file <span class="token operator">=></span> <span class="token punctuation">{</span>
|
module<span class="token punctuation">.</span>exports<span class="token punctuation">.</span>transform <span class="token operator">=</span> file <span class="token operator">=></span> <span class="token punctuation">{</span>
|
||||||
<span class="token keyword">return</span> <span class="token function">transform</span><span class="token punctuation">(</span>file<span class="token punctuation">.</span>src<span class="token punctuation">,</span> <span class="token punctuation">{</span>
|
<span class="token keyword">return</span> <span class="token function">transform</span><span class="token punctuation">(</span>file<span class="token punctuation">.</span>src<span class="token punctuation">,</span> <span class="token punctuation">{</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user