Babel ignore several directories

前端 未结 4 1960
鱼传尺愫
鱼传尺愫 2021-01-01 13:17

I\'m currently running Babel with a simple command :

$ babel . --ignore node_modules --out-dir dist

But I can\'t find a way to ignore sever

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 14:00

    You can ignore multiple directories and specify a globbing pattern within the .babelrc file like this

    {
        ...,
        "ignore": [
            "node_modules",
            "dir_2",
            "dir_3/**/*.js"
        ]
    }
    

    Reference: https://babeljs.io/docs/en/babelrc

提交回复
热议问题