-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathindex.html
More file actions
314 lines (254 loc) · 13.7 KB
/
index.html
File metadata and controls
314 lines (254 loc) · 13.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie ie6 lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie ie7 lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie ie8 lt-ie10 lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie ie9 lt-ie10" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js ffly" lang="en"> <!--<![endif]-->
<head>
<!-- META -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="BrowserSync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices. It&rsquo;s wicked-fast and totally free.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BrowserSync Command Line Usage</title>
<!-- ICONS -->
<link href="/favicon.ico" rel="shortcut icon" type="image/ico">
<!-- CSS Includes (PRODUCTION) -->
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Titillium+Web:400,400italic,700">
<link rel="stylesheet" href="/css/core.min.css"/>
</head>
<body id="page-top">
<header class="wrapper wrapper--dark site-header alt" role="banner">
<div class="container">
<h1 class="site-title alt"><a href="/">BrowserSync</a> / <span><a href="/docs">documentation</a></span></h1>
<ul class="nav--inline docs-nav">
<li><a href="/docs/gulp" >+ Gulp</a></li>
<li><a href="/docs/grunt" >+ Grunt</a></li>
<li><a href="/docs/api" >API</a></li>
<li><a href="/docs/command-line" class="active">Command line</a></li>
<li><a href="/docs/options" >Options</a></li>
<li><a href="/docs/recipes" >Recipes</a></li>
</ul>
</div>
</header><!-- .end .site-header -->
<div class="site-body" role="main">
<section id="top" class="wrapper code-example">
<div class="container">
<div class="grid">
<div class="grid__cell one-quarter">
<div class="sticky-nav">
<p class="lede">Jump to...</p>
<ul class="nav nav--stacked" id="sticky-nav">
<li class="nav-toggle-btn"><a href="#sticky-nav">Menu</a></li>
<li><a href="#command-line-options">Options</a></li>
<li><a href="#files-example">Files Examples</a></li>
<li><a href="#server-example">Server Examples</a></li>
<li><a href="#proxy-example">Proxy Examples</a></li>
<li><a href="#watching-files-example">Watching files + Server</a></li>
</ul>
</div>
</div>
<div class="grid__cell three-quarters">
<article class="doc-wrapper">
<h1 class="text--center">BrowserSync Command Line Usage</h1>
<p>For <strong>tinkering</strong> or quick examples and playing around, the command-line usage can be quite helpful.
After install BrowserSync globally, you can run it like this:</p>
<pre class='highlight'><code class="bash">$ browser-sync start <options>
</code></pre>
<h3 id="command-line-options" class="section-link">
<a href="#command-line-options" class="page-anchor">Options</a>
<a href="#page-top" class="back-to-top">^ TOP</a>
</h3>
<p>These are the options you can use when running BrowserSync</p>
<table>
<tr>
<td>--help</td>
<td>Output usage information</td>
</tr>
<tr>
<td>--version</td>
<td>utput the version number</td>
</tr>
<tr>
<td>--files</td>
<td>File paths to watch</td>
</tr>
<tr>
<td>--exclude</td>
<td>File patterns to ignore</td>
</tr>
<tr>
<td>--server</td>
<td>Run a Local server (uses your cwd as the web root)</td>
</tr>
<tr>
<td>--index</td>
<td>Specify which file should be used as the index page</td>
</tr>
<tr>
<td>--startPath</td>
<td>Specify the start path for the opened browser</td>
</tr>
<tr>
<td>--https</td>
<td>Enable SSL for local development</td>
</tr>
<tr>
<td>--directory</td>
<td>Show a directory listing for the server</td>
</tr>
<tr>
<td>--extensions</td>
<td>Specify file extension fallbacks</td>
</tr>
<tr>
<td>--proxy</td>
<td>Proxy an existing server</td>
</tr>
<tr>
<td>--xip</td>
<td>Use xip.io domain routing</td>
</tr>
<tr>
<td>--tunnel</td>
<td>Use a public URL</td>
</tr>
<tr>
<td>--open</td>
<td>Choose which URL is auto-opened (local, external or tunnel)</td>
</tr>
<tr>
<td>--config</td>
<td>Specify a path to a bs-config.js file</td>
</tr>
<tr>
<td>--host</td>
<td>Specify a hostname to use</td>
</tr>
<tr>
<td>--logLevel</td>
<td>Set the logger output level (silent, info or debug)</td>
</tr>
<tr>
<td>--port</td>
<td>Specify a port to use</td>
</tr>
<tr>
<td>--no-notify</td>
<td>Disable the notify element in browsers</td>
</tr>
<tr>
<td>--no-open</td>
<td>Don't open a new browser window</td>
</tr>
<tr>
<td>--no-online</td>
<td>Force offline usage</td>
</tr>
<tr>
<td>--no-ui</td>
<td>Don't start the user interface</td>
</tr>
<tr>
<td>--no-ghost-mode</td>
<td>Disable Ghost Mode</td>
</tr>
<tr>
<td>--no-reload-on-restart</td>
<td>Don't auto-reload all browsers following a restart</td>
</tr>
</table>
<h3 id="files-example" class="section-link">
<a href="#files-example" class="page-anchor">Files Examples</a>
<a href="#page-top" class="back-to-top">^ TOP</a>
</h3>
<pre class='highlight'><code class="sh"><span class="hljs-comment"># Single file</span>
$ browser-sync start --files <span class="hljs-string">"css/core.css"</span>
<span class="hljs-comment"># Single Pattern</span>
$ browser-sync start --files <span class="hljs-string">"css/*.css"</span>
<span class="hljs-comment"># Multiple files</span>
$ browser-sync start --files <span class="hljs-string">"css/core.css, css/ie.css"</span>
<span class="hljs-comment"># Multiple Patterns</span>
$ browser-sync start --files <span class="hljs-string">"css/*.css, *.html"</span></code></pre>
<h3 id="server-example" class="section-link">
<a href="#server-example" class="page-anchor">Server Examples</a>
<a href="#page-top" class="back-to-top">^ TOP</a>
</h3>
<pre class='highlight'><code class="sh"><span class="hljs-comment"># Static server using current directory as the root</span>
$ browser-sync start --server
<span class="hljs-comment"># Static server using the 'app' directory as the root</span>
$ browser-sync start --server app
<span class="hljs-comment"># Static server using current directory as the root with directory listing</span>
$ browser-sync start --server --directory</code></pre>
<h3 id="proxy-example" class="section-link">
<a href="#proxy-example" class="page-anchor">Proxy Examples</a>
<a href="#page-top" class="back-to-top">^ TOP</a>
</h3>
<pre class='highlight'><code class="sh"><span class="hljs-comment"># Using a local.dev vhost</span>
$ browser-sync start --proxy
<span class="hljs-comment"># Using a local.dev vhost with PORT</span>
$ browser-sync start --proxy local.dev:<span class="hljs-number">8001</span>
<span class="hljs-comment"># Using a localhost address</span>
$ browser-sync start --proxy localhost:<span class="hljs-number">8001</span>
<span class="hljs-comment"># Using a localhost address in a sub-dir</span>
$ browser-sync start --proxy localhost:<span class="hljs-number">8080</span>/site1</code></pre>
<h3 id="watching-files-example" class="section-link">
<a href="#watching-files-example" class="page-anchor">Watching files + Server</a>
<a href="#page-top" class="back-to-top">^ TOP</a>
</h3>
<pre class='highlight'><code class="sh"><span class="hljs-comment"># Watch ALL CSS files for changes with a static server</span>
$ browser-sync start --files <span class="hljs-string">"app/css/*.css"</span> --server
<span class="hljs-comment"># Watch ALL CSS files for changes with a static server using "app" as the base directory</span>
$ browser-sync start --files <span class="hljs-string">"app/css/*.css"</span> --server <span class="hljs-string">"app"</span></code></pre>
</article>
</div>
</div>
</div>
</section>
<script type="text/javascript">
var nav = document.querySelector('.sticky-nav');
var toggle = document.querySelector('.nav-toggle-btn');
var toggleBtn = toggle.querySelector('a');
toggle.addEventListener('click', function (e) {
e.preventDefault();
nav.classList.toggle("active");
var state = toggle.classList.toggle("active");
if (state) {
toggleBtn.innerHTML = "Close X";
} else {
toggleBtn.innerHTML = "Menu";
}
});
</script>
</div>
<footer class="wrapper wrapper--dark site-footer" role="contentinfo">
<div class="container">
<div class="credit">
<a class="credit__thumb" href="http://www.wearejh.com/"><img src="/img/jh-300-trans.png" alt="JH"/></a>
<div class="credit__content">
<p>The BrowserSync project is supported by <a href="http://www.wearejh.com/">JH</a>,
with design and development by
<a href="https://twitter.com/shaneosbourne">Shane Osbourne</a>,
<a href="https://twitter.com/whatjoesays">Joseph Russell</a>,
<a href="https://twitter.com/chris3ailey">Chris Bailey</a> and
<a href="https://twitter.com/o_chenery">Oliver Chenery</a>.
For regular information on updates and usage, please follow <a href="https://twitter.com/browsersync">@browsersync</a>.
</p>
<p>BrowserSync is available for use and modification under the <a href="https://github.com/BrowserSync/browser-sync/blob/master/LICENSE">Apache 2.0 License</a>.</p>
</div>
<p>Website built with <a href="https://github.com/shakyShane/crossbow.js">Crossbow.js</a></p>
</div>
</div>
</footer><!-- end .site-footer -->
<script>
!function(s,y,n,c,I,t){s.GoogleAnalyticsObject=c,s[c]||(s[c]=function(){
(s[c].q=s[c].q||[]).push(arguments)}),s[c].l=+new Date,I=y.createElement(n),
t=y.getElementsByTagName(n)[0],I.src="//www.google-analytics.com/analytics.js",
t.parentNode.insertBefore(I,t)}(window,document,"script","ga");
ga('create', 'UA-48819865-1', 'browsersync.io');
ga('send', 'pageview');
</script>
</body>
</html>