【问题标题】:Watchify does not update when using Webstorm使用 Webstorm 时 Watchify 不更新
【发布时间】:2015-07-11 05:43:51
【问题描述】:

我正在使用 watchify 和 gulp。使用 notepad++ 编辑源代码时,watchify 工作正常,但当我使用 Jetbrain Webstorm 8 进行编辑时,它什么也没做。 这是我的 gulpfile:

var browserify = require('browserify');
var watchify = require('watchify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');

gulp.task('watchify', function(){
    var bundler = browserify('./app/js/app.js', {
        debug: true,
        cache: {}, 
        packageCache: {}
        fullPaths: true
    });
    var watcher  = watchify(bundler);

    return watcher.on('update', function () { // When any files update
            console.log('Updating!');
            var updateStart = Date.now();
            watcher.bundle()
                .pipe(source('bundle.js'))
                .pipe(gulp.dest('./app/js'));
            console.log('Updated!', (Date.now() - updateStart) + 'ms');
        })
        .bundle() // Create the initial bundle when starting the task
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('./app/js'));
});

有没有办法让 watchify 与 Webstorm 一起工作? 感谢您的帮助。

【问题讨论】:

  • 编辑后按Ctrl+S。

标签: gulp webstorm browserify watchify


【解决方案1】:

我发布这个只是为了将来的搜索者 - 我认为这个问题的原因是启用了“使用安全写入”。禁用后问题似乎消失了。

https://github.com/substack/watchify/issues/179

【讨论】:

  • 非常感谢你,你救了我的命。
猜你喜欢
  • 2015-10-21
  • 2015-05-27
  • 1970-01-01
  • 2015-11-19
  • 2016-02-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-14
相关资源
最近更新 更多