T
T
torsar2021-04-29 08:40:20
gulp.js
torsar, 2021-04-29 08:40:20

Why is gulp not opening the host?

gulp.task('browser-sync', function() {
    browserSync.init({
        proxy: "opencardcms.loc",
        port:8082,
        open: true,
        notify: false
    });
});


It's in the hosts file. (127.0.0.14 opencardcms.loc) Opencardcms.loc:8082 opens
from browser . And when you run gulp opens: localhost: 8082 (those are completely different). How to make browsersync open exactly: opencardcms.loc:8082

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Levchenko, 2021-04-29
@nuykon

Read the documentation, everything is there. The idea is like this:
host: "opencardcms.loc",
open: "external",

T
torsar, 2021-04-29
@torsar

gulp.task('serve', function(done) {
  browserSync.init({
    host: "opencardcms.loc",
    port: 8082,
    open: "external"
  });
  
  done();
});

When starting the gallp, it does not open the browser and displays the following in the console:
Copy the following snippet into your website, just before the closing </body> tag
<script id="__bs_script__">//<![CDATA[
    document.write("<script async src='http://HOST:8083/browser-sync/browser-sync-client.js?v=2.26.14'><\/script>".replace("HOST", location.hostname));
//]]></script>

I have opencart.
Where will I look for where to paste this code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question