Babel --out-file in a child folder

108 Views Asked by At

I am trying to compile jsx with babel. I can do it but I want to set --out-file in a child dir. There is I want to do:

website
  src
    file_will_be_compiled.js
    file_was_compiled.js
  package.json

The script I am running on the shell :

babel --watch src/file_will_be_compiled.js --out-dir src --plugins @babel/plugin-transform-react-jsx
1

There are 1 best solutions below

0
On BEST ANSWER

Ok, I solved. The new shell code:

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