Created
March 26, 2018 02:44
-
-
Save bbenjamin/13a44ce70cbed9d05061713b0c118cb0 to your computer and use it in GitHub Desktop.
Transpile Drupal Module/Theme ES6 to ES5 in PHPStorm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In PHPStorm, go to Preferences > Tools > File Watchers | |
Click the plus sign to add a new watcher, and choose Babel | |
Set "Program" to the babel-cli executable. On OSX this might be /usr/local/bin/babel. | |
Or, if babel-cli is installed in node_modules, you can use the version found in node_modules/.bin | |
Set "Arguments" to $FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.es6.js --out-file $FileDirRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.js | |
Set "Output Paths To Refresh" to | |
$FilePathRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.es6.js:$FilePathRelativeToProjectRoot$/$FileNameWithoutAllExtensions$.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment