BrowserSync
BrowserSync automatically refreshes your web browser after you make changes to your front-end resources. You can use the browserSync
method to instruct Elixir to start a BrowserSync server when you run the gulp watch
command:
After running this command you will see directions to add a script tag to the bottom of your website like this:
Add that snippet to your layouts/Main.cfm
file and reload to enable BrowserSync!
Specifying a Proxy
Instead of copying the script tag into you app, you can tell BrowserSync to proxy your existing CFML server:
Running webpack -w
will now open up localhost:3000
which proxies to your app! No need for that BrowserSync script tag anymore!
Default Options
We define a number of default options for BrowserSync:
The can be overridden by passing in an options object as the only parameter (as seen above with proxy
).
Custom Options
In addition to the proxy
option, you may pass any BrowserSync option here as the only argument. A list of the BrowserSync options can be found here.
Last updated