Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Will not launch browser... #2

Open
dantullis opened this issue Nov 10, 2015 · 3 comments
Open

Will not launch browser... #2

dantullis opened this issue Nov 10, 2015 · 3 comments

Comments

@dantullis
Copy link

I cannot get this to launch a new browser or a new tab.

How to reproduce this: I downloaded the "example react-router project"(https://github.com/rackt/react-router), and webpack loads everything fine and I can navigate to localhost:8080 and all works well. However, when i install open-browser-webpack-plugin, add the plugin to "webpack.config.babel.js", and then restart webpack nothing happens. There is no new browser launch or new tab opened.

Here is what I added to "webpack.config.babel.js": new OpenBrowserPlugin({ url: 'http://localhost:8080' })

So, the section looks like this:

plugins: [
  new webpack.optimize.OccurenceOrderPlugin(),
  new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)}),
  new OpenBrowserPlugin({ url: 'http://localhost:8080' })    
]
@baldore
Copy link
Owner

baldore commented Nov 11, 2015

Are you having any errors in the console? Looks like the tab only opens when Webpack doesn't display any error. Working on it.

@dantullis
Copy link
Author

No error in the console. Just double checked. The open open tab is the google homepage. Here is the contents of webpack.config.babel.js in case it helps:

import webpack from 'webpack'
import OpenBrowserPlugin from 'open-browser-webpack-plugin'

export default {

output: {
    library: 'ReactRouter',
    libraryTarget: 'umd'
},

externals: [
    {
        react: {
            root: 'React',
            commonjs2: 'react',
            commonjs: 'react',
            amd: 'react'
        }
    }
],

module: {
    loaders: [
        {
            test: /\.js$/,
            exclude: /node_modules/,
            loader: 'babel'
        }
    ]
},

node: {
    Buffer: false
},

plugins: [
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)}),
    new OpenBrowserPlugin({
        url: 'http://localhost:8080'
    })
]

}

@baldore
Copy link
Owner

baldore commented Dec 26, 2015

Try setting ignoreErrors in the configuration (requires version 0.0.2).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants