• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yantianqi
V2EX  ›  程序员

node 程序中如何添加 babel 配置,解析 es6 模块

  •  
  •   yantianqi · Nov 7, 2018 · 1650 views
    This topic created in 2770 days ago, the information mentioned may be changed or developed.

    想再 node 中用 es6 的模块语法 安装了 @babel/core
    @babel/preset-env

    配置.babelrc

    {
      "presets": [
        "@babel/preset-env"
      ]
    }
    

    还需要怎么配置?

    2 replies    2018-11-07 21:34:31 +08:00
    VDimos
        1
    VDimos  
       Nov 7, 2018 via Android
    你不会还在用老版本的 node 吧,新版本的 node 早就支持 es6 语法了呀
    uxstone
        2
    uxstone  
       Nov 7, 2018
    再配上 webpack babel-loader ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3168 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 12:51 · PVG 20:51 · LAX 05:51 · JFK 08:51
    ♥ Do have faith in what you're doing.