Babel-子文件夹中的输出文件

问题描述 投票:0回答:1

我正在尝试使用babel编译jsx。我可以,但是我想在子目录中设置--out-file。我想做的是:

website
  src
    file_will_be_compiled.js
    file_was_compiled.js
  package.json

我正在外壳上运行的脚本:

babel --watch src/file_will_be_compiled.js --out-dir src --plugins @babel/plugin-transform-react-jsx
compilation jsx babel babel-cli
1个回答
0
投票

好,我解决了。新的shell代码:

babel --watch src/file_will_be_compiled.js --out-file src/compiled_file.js --presets preset-react

© www.soinside.com 2019 - 2024. All rights reserved.