Coder Social home page Coder Social logo

Comments (4)

Va1 avatar Va1 commented on May 21, 2024 1

@mealeyst

Sorry for the delay, having too much stuff happening. However, I did look into issue and here's what I found:

  1. yes, it does open localhost with the config you provided
  2. no, it does not ignore host option, it just uses it for the external url. I guess, this is the proper behavior, as browser-sync server is being hosted on your localhost anyways, and can have aliases (I might be wrong about this, did not find anything related in browser-sync docs)
  3. there is a way to do what you want. you should specify your desired host and it will be used as external url host, then you should add an option property (docs), and set it to external, and it will open your host in the browser.

What I put in config:

var BrowserSyncPlugin = require('browser-sync-webpack-plugin');

module.exports = {
    entry: './src/entry.js',
    output: {
        path: './public',
        filename: 'bundle.js'
    },
    plugins: [
        new BrowserSyncPlugin({
            host: 'abrahadabra.foobar.com',
            port: 3030,
            server: { baseDir: ['public'] },
            open: 'external'
        })
    ]
};

What I see in console:

[BS] Access URLs:
 -----------------------------------------------
       Local: http://localhost:3030
    External: http://abrahadabra.foobar.com:3030
 -----------------------------------------------
          UI: http://localhost:3001
 UI External: http://abrahadabra.foobar.com:3001
 -----------------------------------------------
[BS] Serving files from: public

What I see in browser:

http://abrahadabra.foobar.com:3030/

I feel like this issue is about browser-sync configuration and documentation, not about the plugin.

from browser-sync-webpack-plugin.

Va1 avatar Va1 commented on May 21, 2024

Hey!

Hm, let me check this out.

from browser-sync-webpack-plugin.

mealeyst avatar mealeyst commented on May 21, 2024

@Va1 Thank you so much for looking into this, if you need any other details as well I'd be happy to help.

from browser-sync-webpack-plugin.

Va1 avatar Va1 commented on May 21, 2024

I assume, the issue is closed.

from browser-sync-webpack-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.