How to use the transformFile function from babel-core

Find comprehensive JavaScript babel-core.transformFile code examples handpicked from public code repositorys.

2
3
4
5
6
7
8
9
10
11
12
const babel = require('babel-core');


module.exports = (filePath, callback) => {
  // Transform the file.
  // Check process.env.NODE_ENV to see if we should create sourcemaps.
  babel.transformFile(
    filePath,
    {
      sourceMaps: process.env.NODE_ENV === 'development' ? 'inline' : false,
      comments: false,
fork icon4
star icon1
watch icon0