Macil / browserify-hmr

Hot Module Replacement plugin for Browserify
MIT License
373 stars 26 forks source link

Doesn't work with factor-bundle #34

Closed whaaaley closed 4 years ago

whaaaley commented 7 years ago
const browserify = require('browserify')
const watchify = require('watchify')
const hmr = require('browserify-hmr')
const fs = require('fs')

const entries = [
  'src/dash.js',
  'src/home.js'
]

const outputs = [
  'dist/dash.js',
  'dist/home.js'
]

var b = browserify({ entries: entries, cache: {}, packageCache: {} })
  .transform('vueify')
  .plugin(watchify)
  .plugin(hmr)
  .plugin('factor-bundle', { outputs: outputs })

function bundle() {
  b.bundle().pipe(fs.createWriteStream('dist/common.js'))
}

b.on('update', bundle)
bundle()

There's a high chance I'm doing something wrong here, but i've spent a whole day trying different ways but the output is always _hmr_manager.js. I've also tried doing CLI commands and no luck there either.

Macil commented 7 years ago

Sorry, I don't think it's compatible with factor-bundle right now. I'll look into this sometime.