- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 watchify 自动构建我的 bundle.js
,但不幸的是,当我保存文件时,没有触发任何更新事件。
var bundler = watchify(browserify({
debug: true,
entries: ['./js/main.js'],
transform: "babelify",
cache: {}, packageCache: {}, fullPaths: true
}))
.on("update", function () {
var updateStart = Date.now();
console.log(updateStart);
return bundler
.bundle()
.pipe(exorcist(path.join(distPath, "bundle.js.map")))
.pipe(fs.createWriteStream(path.join(distPath, "bundle.js")));
})
.bundle()
.pipe(exorcist(path.join(distPath, "bundle.js.map")))
.pipe(fs.createWriteStream(path.join(distPath, "bundle.js")));
当我使用 CLI 时,行为是相似的:构建在启动后运行一次,仅此而已。
watchify ./js/main.js -o js-dist/bundle.js -v
我正在使用 OS X Yosemite。
最佳答案
我也遇到了同样的问题。我使用了 gulp repro 中的食谱。第一个 bundlejs 任务按预期工作。但是,当我更改为依赖项之一时,什么也没有发生。
似乎没有运行更新功能。但是,在 main.js 文件中所做的更改会重新编译。因此,任务以某种方式重新运行,但具有缓存的依赖项。
关于javascript - Watchify 不发出更新事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29222702/
我在一个文件夹下有一堆具有共同依赖项的应用程序。 /app/app1/src/main.js /app/app2/src/main.js /app/app3/src/main.js /common/t
我正在尝试使用 watchify 自动构建我的 bundle.js,但不幸的是,当我保存文件时,没有触发任何更新事件。 var bundler = watchify(browserify({
我的 watchify-program不检测子模块的变化。 子模块位于 ../js/lib/melajs/**/*.js 当我运行 browserify-program但是它确实编译了子模块。 下面是
尝试使用 watchify 一段时间了,但我在保存时遇到了问题。 似乎对于我所做的每一个更改,我都需要保存两次才能将更改应用到输出中。 如果我在任何 js 文件中添加代码,则仅当任务运行两次时才会显示
我已经为监视创建了这个 gulp 任务,但它给出了这个错误:无法读取未定义的属性“缓存” gulp.task('browserify-With-Watch', function () { "use s
我正在使用 Browserify 来捆绑我所有的 Javascript Assets 。但是,随着应用程序变得越来越复杂,Browserify 的构建速度开始变得非常缓慢,所以我切换到 Watchif
我想设置 gulp 以便能够做两件事:1) 使用 watchify 监视文件中的更新并在更改时使用 browserify 自动重建,以及 2) 进行一次临时构建并退出。 #1 似乎工作正常,但我无法让
我正在添加 watchify到我们的构建过程,但我想设置一个先决条件来监视运行,即更改的文件通过了我们的 linting 步骤(使用 ESLint)。 我想这样做: function runBrows
我试图让 watchify 与 Gulp 一起工作,但似乎从未触发过“更新”事件。 这是我的 gulpfile.js: "use strict"; var gulp = require('gulp')
来自 watchify 的文档, 我懂了: When creating the browserify instance b you MUST set these properties in the c
这是我的 gulpfile.js var gulp = require('gulp'); var browserify = require('browserify'); var source = re
我正在学习有关 Reactjs 的教程,我们正在使用 Gulpfile 来更新依赖项并使用 browserify 构建单个 javascript 文件。 出于某种原因,每当我更改文件中的一行时都没有更
我正在使用 gulp、browserify 和 watchify。这是我的“脚本”任务: gulp.task('scripts', function() { var b = watchify(
我创建了一个 gulp 任务,用于将模块与 browserify 捆绑在一起,我正在使用 watchify 来监视更改。这是我的 watchify gulp 任务: gulp.task('watch:
我使用 babel-plugin-transform-html-import-to-string 将 html 模板文件导入到我的 javascript 组件中. 当我使用 watchify 时,如果
这是一个典型的工作流程: 编辑JS文件 保存文件,watchify 自动开始为我重建它 alt-tab 到浏览器 ctrl+R 重新加载页面 这很好,除非 watchify 花费的时间比第 3 步和第
我希望我的 gulpfile.js 任务 watch 在更新路径中的 html 文件时运行,而不仅仅是 javascript 文件。看起来即使我的基本目录没有指定 *.js,它也是假设的。 我的 gu
我开始开发 Chrome 扩展。到目前为止,我使用 gulp 设置项目来查看包含背景、弹出窗口、内容和其他一些页面代码的文件夹。每个组件与其他组件共享一些代码。 问题是每次我编辑文件时 watchif
我的 javascript 代码中需要 Node.js 功能,例如 require() 函数,因此我使用 watchify,但它仍然给我错误 Uncaught ReferenceError: requ
我想做什么?我想使用节点模块和 es6 javascript 语法创建一个项目。为了使其尽可能模块化和独立,我决定改用 watchify。我的 html 页面看起来像这样 ...some unrela
我是一名优秀的程序员,十分优秀!