Results 1 to 2 of 2

Thread: How to turn off automatically open browser after webpack-dev-server starts ?

  1. #1

    Default How to turn off automatically open browser after webpack-dev-server starts ?

    Hi,
    I am using ExtAngular 7, and I want to not automatically open browser tab whenever I start my local server.
    In webpack.config.js, I tried to set open: false for devServer block:
    Code:
    devServer: {
        contentBase: outputFolder,
    historyApiFallback: true,
    hot: !isProd,
    host: '0.0.0.0',
    port: port,
    open: false,
    disableHostCheck: false,
    compress: isProd,
    inline: !isProd,
    stats: 'none'
    }
    However, when I start, ext plugin will still open new browser tab:

    Code:
    ℹ 「ext」: Opening browser at http://localhost:4501
    ℹ 「ext」: Ending development build for angular
    ℹ 「wdm」: Compiled successfully.

  2. #2
    Sencha Premium Member
    Join Date
    Mar 2016
    Posts
    9

    Default

    In pluginUtil.js of the sencha webpack plugin module, there are the following lines:

    Code:
    if (options.browser == true && options.watch == 'yes' && vars.production == false) { if (vars.browserCount == 0) {
    var url = 'http://localhost:' + options.port;
    
    
    require('./pluginUtil').log(vars.app + `Opening browser at ${url}`);
    
    
    vars.browserCount++;
    
    
    const opn = require('opn');
    
    
    opn(url);
    }
    }
    You can either unset the options.watch parameter to something different or if that doesn't work comment out those lines.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •