Make babel exclude test files

前端 未结 2 482
日久生厌
日久生厌 2021-02-03 17:00

On my build step I\'m using babel to transpile the code to es5 (from src to dist). How do I make it exclude files ending in .test.js?

2条回答
  •  时光取名叫无心
    2021-02-03 17:30

    As of today, the following works in .babelrc (babel-core: v6.26.3)

    "ignore": [
      "**/__tests__", // ignore the whole test directory
      "**/*.test.js" // ignore test files only
    ]
    

提交回复
热议问题