簡體   English   中英

使用Webstorm時Watchify不會更新

[英]Watchify does not update when using Webstorm

我正在用大量的手表。 當使用notepad ++編輯源代碼時,watchify可以正常工作,但是當我使用Jetbrain Webstorm 8進行編輯時,它什么也沒做。

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'));
});

無論如何,有什么要使見證服務器與Webstorm一起工作的? 謝謝你的幫助。

我發布此文章只是為了將來的搜索者-我認為導致該問題的原因是Enabled“ Use safe write” 禁用后問題似乎消失了。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM