From a5773d3833ce6de9f545eadc0f14903b328579c8 Mon Sep 17 00:00:00 2001 From: Zhenfei You Date: Mon, 2 Jul 2018 20:17:37 +0800 Subject: [PATCH] * [jsfm] using rollup.watch to fix dev build --- build/build.js | 13 +++++++------ package.json | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/build.js b/build/build.js index 4c4e5300b8..f2c80364f5 100644 --- a/build/build.js +++ b/build/build.js @@ -20,7 +20,6 @@ const fs = require('fs') const path = require('path') const rollup = require('rollup') -const watch = require('rollup-watch') const getConfig = require('./config') let isWatch = false @@ -37,17 +36,19 @@ else { } function runRollupOnWatch (config) { - const watcher = watch(rollup, config) + const watcher = rollup.watch(config) watcher.on('event', event => { switch (event.code) { - case 'STARTING': console.log('checking rollup-watch version...'); break - case 'BUILD_START': console.log('bundling...'); break - case 'BUILD_END': { - console.log('bundled in ' + path.relative(process.cwd(), config.dest) + case 'START': break + case 'BUNDLE_START': console.log('bundling...'); break + case 'BUNDLE_END': { + console.log('bundled in ' + config.output.file + ' (' + event.duration + 'ms)') console.log('Watching for changes...') } break + case 'END': break case 'ERROR': console.error('ERROR: ', event.error); break + case 'FATAL': console.error('FATAL: ', event.error); break default: console.error('unknown event', event) } }) diff --git a/package.json b/package.json index 00f37ab885..8a49cc24c4 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,6 @@ "rollup-plugin-node-resolve": "^3.0.0", "rollup-plugin-replace": "^2.0.0", "rollup-plugin-uglify": "^2.0.1", - "rollup-watch": "^4.3.1", "selenium-server": "2.53.1", "serve": "^1.4.0", "shelljs": "^0.7.8",