Skip to content

Status/progress is not showing #109

@rosskevin

Description

@rosskevin
  • Webpack Version: webpack@4.28.4
  • Operating System (or Browser): OSX/chrome 72.0.3626.96/firefox dev 66.0b3
  • Node Version: 11.9
  • webpack-plugin-serve Version: webpack-plugin-serve@0.6.0

How Do We Reproduce?

I have a small typescript helper to add webpack-plugin-serve to my config:

import { Configuration } from 'webpack'
import { Config } from './Config'
import { WebpackPluginServe } from 'webpack-plugin-serve'

export const useWebpackPluginServe = (config: Config, wc: Configuration) => {
  const { paths, PROD } = config
  if (PROD) {
    return wc
  }

  // ← important: this is required, where the magic happens in the browser
  ;(wc.entry as string[]).push('webpack-plugin-serve/client')

  // ← important: webpack and the server will continue to run in watch mode
  wc.watch = true

  wc.plugins!.push(
    new WebpackPluginServe({
      compress: true,
      historyFallback: true,
      host: config.ipAddress(),
      port: 3808,
      liveReload: true,
      // set CORS headers
      middleware: (app: any, builtins: any) =>
        app.use(async (ctx: any, next: any) => {
          await next()
          ctx.set('Access-Control-Allow-Headers', '*')
          ctx.set('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
          ctx.set('Access-Control-Allow-Origin', '*')
        }),
      static: paths.output(), // needs to be the same as the output dir for the html-webpack-plugin

      //
      status: true,
      progress: true,
    }),
  )

  // override the publicPath since production may be set to assets host
  wc!.output!.publicPath = '/'

  return wc
}

Expected Behavior

progress/status show in the browser

Actual Behavior

App serves fine, see console messages from wps, but no visible overlay in the browser.

I can provide more information, I just don't want to dump everything here. What information would be useful? Should I be able to inspect the dom and see a top level element (so far I do not)?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions