Code Monkey home page Code Monkey logo

Comments (8)

mdreizin avatar mdreizin commented on July 21, 2024

@timc13

gulp.task('watch', [], function(callback) {
    var webpack = new WebpackGlob(compilerOptions, webpackOptions);

    webpack.watch('./src/**/webpack.config.js').then(function() {
        callback();
    }).catch(function(err) {
        callback(new gutil.PluginError('webpack', err));
    });
});

from webpack-cluster.

timc13 avatar timc13 commented on July 21, 2024

I assume that's for watching changes to the config file?

What about watching changes to JS to rebuild the bundle ? (per your example in the webpack-config-stream README)

Here's what I have so far:

gulp.task('build:webpack', function(callback) {
  var webpack = new webpackGlob(compilerOptions, configOptions)
  webpack.run(configFilename)
});

gulp.task('watch:webpack', ['build:webpack'], function(callback) {
  var webpack = new webpackGlob(compilerOptions, configOptions)
  gulp.watch(webpackWatch).on('change', function(event) {
    if (event.type === 'changed') {
      webpack.run(configFilename)
    }
  })
});

This doesn't seem to work - gulp gets stuck and I can't even Ctrl+C out of it.

from webpack-cluster.

mdreizin avatar mdreizin commented on July 21, 2024

@timc13 I'm working on new version which will fix some issues (Ctrl+C as well).

You don't need to call webpack.run, because webpack-glob uses gaze for watching.

from webpack-cluster.

mdreizin avatar mdreizin commented on July 21, 2024

@timc13 just call webpack.watch with minimatch pattern.

from webpack-cluster.

timc13 avatar timc13 commented on July 21, 2024

I'm sorry, maybe I'm missing something I've tried an array of strings, a single string with comma-delimited globs and separate arguments and nothing seems to be triggering a rebuild.

Here's what I got:

gulp.task('build:webpack', function(callback) {
  var webpack = new webpackGlob(compilerOptions, configOptions)
  webpack.run(configFilename).then(function() {
    callback()
  }).catch(function(err) {
    callback(new gutil.PluginError('webpack', err))
  })
});

gulp.task('watch:webpack', ['build:webpack'], function(callback) {
  var webpack = new webpackGlob(compilerOptions, configOptions)
  webpack.watch(configFilename, './public/angular/**/*', '!./public/angular/**/*.html').then(function() {
    callback()
  }).catch(function(err) {
    callback(new gutil.PluginError('webpack', err))
  })
});

from webpack-cluster.

mdreizin avatar mdreizin commented on July 21, 2024

@timc13 I will fix that in new version, currently only one param is accepted.

from webpack-cluster.

mdreizin avatar mdreizin commented on July 21, 2024

@timc13 Here is preview https://github.com/mdreizin/webpack-cluster/blob/es6/src/CompilerAdapter.js#L99

from webpack-cluster.

mdreizin avatar mdreizin commented on July 21, 2024

@timc13 Also please see https://github.com/mdreizin/webpack-cluster/blob/es6/.gitdown/gulpfile.js#L38

from webpack-cluster.

Related Issues (19)

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.