2017-08-29 30 views
0

我的項目不是基於節點的,因此我使用從CDN下載的browser.js babel組件在瀏覽器中轉發我的jsx代碼。如何在瀏覽器中轉譯時使用transform-class-properties babel插件

我想使用transform-class-properties babel插件,但我無法弄清楚在CDN瀏覽器中使用babel時如何使其工作。

是的,我知道我應該使用webpack並預先傳輸我所有的jsx代碼。我保證我會最終。

+0

https://github.com/babel/babel-standalone#usage –

回答

0

拼寫出來:

<script src="https://unpkg.com/[email protected]/babel.min.js"></script> 
<!-- Your custom script here --> 
<script type="text/babel" data-plugins=""> 
// 
// your jsx goes here 
// 
</script>