Getting Babel to view two folders

Purpose: I have two subfolders (jsx for jsx files) and (dash7 for ECMA-2017 scripts). I don't want to combine these folders. I want to set up VSCODE tasks that both folders can view.

Problem: I now have two separate tasks. One "jsx watch" is another "es7 watch". I can only run once with VS Code.

Question: Is there a way to write a task that does both, or is there a way to make Babel look at two separate folders. Or another solution?

{
    "version": "0.1.0",
    "command": "${workspaceRoot}/node_modules/.bin/babel.cmd",
    // "isShellCommand": true,
    "tasks": [
        {
            "args": ["jsx", "--out-dir", "jsxo", "-w", "--source-maps inline"],
            "taskName": "jsx watch",
            "suppressTaskName": true,
            "isBuildCommand": true, // make this the F1 > Task: Run Build Task gesture
            "isBackground": true // tell VS Code not wait for this task to finish
        },
        {
            "args": ["dash7", "--out-dir", "dash", "-w", "--source-maps inline"],
            "taskName": "es7 watch",
            "suppressTaskName": true,
            "isBuildCommand": true, // make this the F1 > Task: Run Build Task gesture
            "isBackground": true // tell VS Code not wait for this task to finish
        }
    ]
}

      

Babel presets

  "babel": {
    "sourceMaps": "inline",
    "presets": [
      "react",
      "node7"
    ]

      

+3


source to share


1 answer


VSCODE users just updated Visual Code with the new terminal:

https://github.com/Microsoft/vscode/issues/981



If you change the version to 2.0.0 , you can run multiple tasks at once!

{
    "version": "2.0.0",
    "command": "${workspaceRoot}/node_modules/.bin/babel.cmd",
    // "isShellCommand": true,
    "tasks": [
        {
            "args": ["jsx", "--out-dir", "jsxo", "-w", "--source-maps inline"],
            "taskName": "jsx watch",
            "suppressTaskName": true,
            "isBuildCommand": true, // make this the F1 > Task: Run Build Task gesture
            "isBackground": true // tell VS Code not wait for this task to finish
        },
        {
            "args": ["dash7", "--out-dir", "dash", "-w", "--source-maps inline"],
            "taskName": "es7 watch",
            "suppressTaskName": true,
            "isBuildCommand": true, // make this the F1 > Task: Run Build Task gesture
            "isBackground": true // tell VS Code not wait for this task to finish
        }
    ]
}

      

+2


source







All Articles