vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 685 forks source link

Javascript task does not work when using browserSync proxy #551

Open tommymarshall opened 6 years ago

tommymarshall commented 6 years ago

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 commented 5 years ago

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

Apparently https://github.com/vigetlabs/blendid/pull/503 has added an option extraMiddlewares that allow us to add additional proxy middleware.

https://github.com/vigetlabs/blendid/blob/6a29c48c89372d6a0bd1a9b60342ce6d38621763/gulpfile.js/tasks/browserSync.js#L36-L44

Usage

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