Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to edit Babel transpiled files in Chrome devtools workspace?

Dragging a local folder of files into the devtools adds them to the workspace so that you can persistently edit them. I just discovered the feature. However my files are all Babel transpiled and then I edit a file and hit cmd-s to save the changes Chrome checks the source and trips over es6 import statements with the error: Unexpected token import

Is there a way to make chrome not check the syntax? If it just edited the file without trying to compile it, Babel could pick it up and inject the changes via hot module replacement probably.

like image 482
Thijs Koerselman Avatar asked Oct 31 '22 11:10

Thijs Koerselman


1 Answers

I recently watched this presentation named "Debugging the Web" on the new Chrome devtools. At around 15mins he talks about this subject.

Before you could make it work with proper configuration. With this update it should work out of the box!

like image 108
Thijs Koerselman Avatar answered Nov 09 '22 12:11

Thijs Koerselman