Git Product home page Git Product logo

Comments (9)

avanderhoorn avatar avanderhoorn commented on May 28, 2024 1

So are you guys actually using gulp-webpack and then working webpack-dev-server into it somehow or using webpack directly and passing the compiler into webpack-dev-server? Any gist's that you have of the basic setup, might make it clearer?

from webpack-stream.

ampedandwired avatar ampedandwired commented on May 28, 2024

I'm just using webpack-dev-server. For my app I've found that webpack is flexible enough that I can do most things without having to use gulp at all.

from webpack-stream.

kompot avatar kompot commented on May 28, 2024

I'm also using webpack-dev-server along with react-hot-loader. Gulp is doing only very high-level task orchestration (like deciding which webpack mode will run — dev or production). Everything is done in webpack and it's awesome.

from webpack-stream.

kompot avatar kompot commented on May 28, 2024

We have this kind of setup.

var gulp = require('gulp');
var $ = require('gulp-load-plugins')({
  pattern: 'gulp{-,.}*',
  replaceString: /gulp(\-|\.)/,
  camelize: true
});
var webpack = require('webpack');

var webpackTask = function(config, dst) {
  return gulp.src(paths.src.js)
    .pipe($.webpack(config, webpack))
    .pipe(gulp.dest(dst));
};

gulp.task('webpack:client', function() {
  var config = require('./webpack.config.client');
  return webpackTask(config, './dev/client/js');
});

And in server.js we check if running in development mode then fire up webpack-dev-server.

from webpack-stream.

koistya avatar koistya commented on May 28, 2024

Here is how I'm currently doing live-reload with Webpack and BrowserSync:

https://github.com/kriasoft/React-Seed/blob/88eabc907aa0f3f8be6a00663f265cbc94262276/gulpfile.js#L114-L141

from webpack-stream.

avanderhoorn avatar avanderhoorn commented on May 28, 2024

@koistya Thanks! Just wondering what embedding the livereload snippet in html files?

from webpack-stream.

koistya avatar koistya commented on May 28, 2024

@avanderhoorn BrowserSync has a built-in LiveReload functionality, unfortunately it doesn't support Webpack HMR yet, but maybe it will be introduced in the next release:

BrowserSync/browser-sync#246

from webpack-stream.

avanderhoorn avatar avanderhoorn commented on May 28, 2024

Big thanks this really helped and got it all up and running.

from webpack-stream.

nilssolanki avatar nilssolanki commented on May 28, 2024

@avanderhoorn how did you get HMR to work?

from webpack-stream.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.