Va1 / browser-sync-webpack-plugin

Easily use BrowserSync in your Webpack project.
MIT License
369 stars 40 forks source link

Doesn't work with WSL (Windows Subsystem for Linux) #85

Closed mthines closed 4 years ago

mthines commented 4 years ago

Hello.

The plugin currently doesn't work when running through WSL. It looks like it spins up BrowserSync up correctly, but I can't access the link it generates on other devices. image

I tried to install Node and Browser-Sync through Powershell :( :( :(, and there it works fine. So it must be something with the WSL.

Do you have an suggestion for what it might could be, or could you guide me to where I might look if I were to make a fix and create a PR?

Here's my Webpack Config

// ... webpack
plugins = [
  new BrowserSyncPlugin(
    {
      host: 'localhost',
      port: 4000,
      proxy: 'http://localhost:3000',
      injectFileTypes: ['*.ts', '*.tsx', '*.js', '*.scss'],
      ui: {
        port: 4001,
      },
    },
    {
      reload: false,
    },
  ),
]

Thanks a ton for the plugin! I've been using it a lot on other projects 💪

Va1 commented 4 years ago

hello!

sorry fore delayed reply.

the issue is in browser-sync or webpack itself, i believe, because this package is a rather thin glue between those two and is relying on their os/filesystem mechanisms. i would suggest trying to verify if watch mode of webpack works at all if installed through WSL. same for browser-sync refresh functionality. if either fails, then you should proceed in respective repository issues. or come back here if i am wrong.

appreciated, man :)

cheers