Babel file is copied without being transformed

前端 未结 10 2185
礼貌的吻别
礼貌的吻别 2020-11-22 06:09

I have this code:

\"use strict\";

import browserSync from \"browser-sync\";
import httpProxy from \"http-proxy\";

let proxy = httpProxy.createProxyServer({         


        
10条回答
  •  悲&欢浪女
    2020-11-22 06:54

    Ultimate solution

    I wasted 3 days on this

    import react from 'react' unexpected identifier
    

    I tried modifying webpack.config.js and package.json files, and adding .babelrc, installing & updating packages via npm, I've visited many, many pages but nothing has worked.


    What worked? Two words: npm start. That's right.

    run the

    npm start 
    

    command in the terminal to launch a local server

    ...

    (mind that it might not work straight away but perhaps only after you do some work on npm because before trying this out I had deleted all the changes in those files and it worked, so after you're really done, treat it as your last resort)


    I found that info on this neat page. It's in Polish but feel free to use Google translate on it.

提交回复
热议问题