Babel with browser.js, getting Uncaught SyntaxError: Invalid regular expression

前端 未结 2 1470
太阳男子
太阳男子 2020-12-29 06:59

I\'m trying to use Babel in Chrome with the browser.js script.

I created a symlink pointing to the node_modules directory based on my node installation so i can reac

相关标签:
2条回答
  • 2020-12-29 07:19

    Just add the UTF-8 encoding

    <script type="text/javascript" src="yourScript.js" charset="utf-8"></script>

    0 讨论(0)
  • 2020-12-29 07:30

    Babel #340

    You must set the Content-Type on the HTML page, or on the JS file header.

    <meta charset="utf-8" />
    // OR
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    // OR
    <script src="scripts.js" charset="utf-8"></script>
    

    or in the headers of the JS file:

    Content-Type: application/javascript;charset=UTF-8
    
    0 讨论(0)
提交回复
热议问题