Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Javascript task does not work when using browserSync proxy #551

Open
tommymarshall opened this issue Mar 6, 2018 · 1 comment
Open

Javascript task does not work when using browserSync proxy #551

tommymarshall opened this issue Mar 6, 2018 · 1 comment

Comments

@tommymarshall
Copy link
Contributor

You also cannot tell blendid not to use webpack-dev-middleware to get around this so we can at least build the JS file locally.

@amoshydra
Copy link

Faced a similar issue while trying to setup additional proxy middleware in browsersync.

Apparently #503 has added an option extraMiddlewares that allow us to add additional proxy middleware.

server.middleware = server.middleware || [
require('webpack-dev-middleware')(compiler, {
stats: 'errors-only',
watchOptions: TASK_CONFIG.browserSync.watchOptions || {},
publicPath: pathToUrl('/', webpackConfig.output.publicPath)
}),
require('webpack-hot-middleware')(compiler)
].concat(server.extraMiddlewares || [])

Usage

  browserSync: {
    server: {
      extraMiddlewares: [
        proxy({
          ...url.parse('http://api-server/api'),
          route: '/api',
        }),
      ],
    },
    port: 8888,

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