[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [jsfm] using rollup.watch to fix dev build
Browse files Browse the repository at this point in the history
  • Loading branch information
imyzf committed Jul 2, 2018
1 parent 0557cf6 commit a5773d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
})
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a5773d3

Please sign in to comment.