node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป


VTEX Flash

Author: Marcos Casagrande
Copyright: Copyright (C) Marcos Casagrande - All Rights Reserved | Todos los derechos reservados

VTEX Flash server, reverse proxy, include files, custom IFs!


After download uncompress the folder.

Enter the folder and run:

sudo ./configure

You can change the configuration later on in vf.ini file (See command below)

   "root": "/var/www/html/",
   "host": "develop-{{environment}}",
   "liveReload": true,
   "mappings": {
      "myenvironment": "myenvironmentfolder"
   "websites": {}
  • root: The root directory where your environments are. VF will retrieve the local files from there.
  • host (optional): The host that will be use as reverse proxy. By default {{environment}} is used. ({{environment}} is a variable, and you should NOT replace it).
  • liveReload (optional): [Default: false] Whether to activate CSS Live Reload or not.
  • mappings (optional): By default VTEX Flash will serve files from folders that are the same as the environment, if your environment is example, VF will go to /var/www/html/example if you want it to search in other location, you should map it!

Quick Start

Run this command: (If you reboot your computer/server, it should start automatically)

sudo service vtexflash start

Edit your hosts file.

sudo nano /etc/hosts

And add the following:

#If your are running VTEX Flash in a server, replace with the server IP address

Now enter: and done!

VTEX Flash will serve CSS & JS files from /var/www/html/example/src/styles && /var/www/html/example/src/js in your local machine / server. You may change the root path or map the environment in vf.ini as explained above

If the file doesn't exist in your server, it will use the one from VTEX if it exists.


Stop the server

sudo service vtexflash stop

Start the server

sudo service vtexflash start

Restart the server

sudo service vtexflash restart

Check status

sudo service vtexflash status


sudo vtexflash update

Show errors

#sudo vtexflash -l <lines> | default lines: 10
sudo vtexflash -l


#sudo vtexflash --log <lines> | default lines: 10
sudo vtexflash --log 50

Edit vf.ini

sudo vtexflash -e


sudo vtexflash --edit

To create new environment, with presets

sudo vtexflash install -e environmentname
cd environmentname


sudo vtexflash install --env=environmentname
cd environmentname


Currently supported:

  • Custom IF syntax for environments:

      [IF example-brasil] 
          console.log("This is!");
      console.log("This is a global message!");
      [IF example-argentina] 
         console.log("This is!");
      console.log("Es magicoooo!");         
  • Custom include syntax:

      [include '/js/my-js.js']
      //... rest of code  

If you have any trouble setting up VTEX flash email me: