Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent `jsx watch` from compiling swap files?

Tags:

reactjs

I'm using vim has an editor. JSX compiles the swap/temporary files. How can I avoid that ?

Command line :

jsx --extension js --watch src/ build/

What I see in stdout :

.helloworld.js.swp changed; rebuilding...
["helloworld"]
["helloworld"]
helloworld.js~ changed; rebuilding...
helloworld.js~ changed; rebuilding...
["helloworld"]
["helloworld"]

Thanks. :)

like image 665
Filippo Avatar asked Oct 31 '22 18:10

Filippo


1 Answers

VIM solution:

You can set the swap folder to a different folder.

 set directory^=$HOME/.vim/swap// 

Grunt solution:

You can use one of the many plugin available to watch and rebuild the your jsx files. These plugins allow you to set which files to use in the build process. For example: https://www.npmjs.com/package/grunt-react

like image 130
Giuseppe Pes Avatar answered Nov 07 '22 22:11

Giuseppe Pes