update website [ci skip]

This commit is contained in:
Website Deployment Script 2018-04-12 00:18:03 +00:00
parent 0742622f93
commit 7b97c44ee5

View File

@ -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">&#x27;module&#x27;</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">&#x27;module&#x27;</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">&#x27;@babel/core&#x27;</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">&#x27;@babel/core&#x27;</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">=&gt;</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">=&gt;</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>