首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >让babel看两个文件夹

让babel看两个文件夹
EN

Stack Overflow用户
提问于 2017-05-05 16:13:11
回答 1查看 469关注 0票数 3

目标:我有两个子文件夹(jsx用于jsx文件)和(用于ECMA-2017脚本的dash7),我不想合并这些文件夹。我希望设置一个可以监视两个文件夹的VSCODE任务。

问题:现在有两个独立的任务。一个是"jsx手表“,另一个是"es7手表”。我一次只能用VS代码运行一个。

问题:是否有一种方法可以同时完成两种任务,或者有一种方法可以让babel查看两个单独的文件夹。还是另一个解决方案?

代码语言:javascript
复制
{
    "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预设

代码语言:javascript
复制
  "babel": {
    "sourceMaps": "inline",
    "presets": [
      "react",
      "node7"
    ]
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-08 15:20:11

VSCODE人员刚刚用一个新的终端运行程序更新了VSCODE:

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

如果将版本更改为2.0.0,则可以一次运行多个任务!

代码语言:javascript
复制
{
    "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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43809502

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档