我正在尝试使用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
好,我解决了。新的shell代码:
babel --watch src/file_will_be_compiled.js --out-file src/compiled_file.js --presets preset-react