Tips and tricks

Use Browserify Globally as Watcher in PhpStorm

First, we need to install browserify globally

Open terminal and say

sudo npm install -g browserify@16.5.0 @babel/core@^7 @babel/plugin-transform-runtime@^7

Make sure that in Program you may have

/usr/local/lib/node_modules/browserify/bin/cmd.js

Then in Arguments

$FilePath$
-o
$FileDir$/$FileNameWithoutAllExtensions$.js

Then in Output paths to refresh

dist/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.js:dist/$FileDirRelativeToProjectRoot$/$FileNameWithoutExtension$.js.map

optional:

You could extend with babelify

tutorial here

Remember to set in Program argument ( if using PhpStorm ):

/usr/local/lib/node_modules/browserify/bin/cmd.js

You could extend with minifyify

npm i -g minifyify@7.3.5

Then you can just do:

$FilePath$
-d
-p
[/usr/local/lib/node_modules/minifyify/lib/index.js
--map
$FileNameWithoutAllExtensions$.js.map
--output
$FileNameWithoutAllExtensions$.js.map
]
-o
$FileDir$/$FileNameWithoutAllExtensions$.js

make sure to name your files

file.source.js
sudo npm install -g browserify @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime @babel/preset-react core-js minifyify babelify

Leave a comment

Your email address will not be published

{"type":"main_options","images_arr":"'#ffffff'","bg_slideshow_time":"0","site_url":"https:\/\/digitalzoomstudio.net","theme_url":"https:\/\/digitalzoomstudio.net\/wp-content\/themes\/qucreative\/","is_customize_preview":"off","gallery_w_thumbs_autoplay_videos":"off","base_url":"https:\/\/digitalzoomstudio.net"}