rollup/rollup-watch

Generating a source map leads to endless bundling loop

Opened this issue · 3 comments

I have config options that look like this:

{
  format: 'iife',
  plugins: [
    babel({
      babelrc: false,
      exclude: ['node_modules/**', 'bower_components/**'],
      presets: [ [ 'es2015', { modules: false } ], 'stage-0', 'react' ],
      plugins: [ 'external-helpers' ]
    }),
    commonjs({
      include: 'node_modules/**',
      exclude: 'node_modules/process-es6/**',
    }),
    globals(),
    replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
    resolve({
      jsnext: true,
      browser: true,
      main: true
    })
  ],
  sourceMap: true
}

Then I run rollup from command line like this:

rollup -w -c config/rollup.dev.js -i js/main.js -o ../dist/js/main.js

Now when I make a few changes quite fast and save in between rollup gets stuck in a bundling loop. If I set sourceMap: false this won't happen.

Started experiencing this today.

Any tips you have found to resolve this?

Probably related to:

#7
#21

Basically some kind of issue with deepClone -- I have it temporarily resolved by using JSON.stringify() instead of deepClone as suggested here: rollup/rollup#1010

I made my own small watch wrapper around rollup called wrollup on npm that fixes some of the issues I've had with rollup like this among a few other things like auto recovery on failure, cleaner error reporting etc -- works fine for now until rollup-watch is up to scratch.

https://github.com/talmobi/wrollup
https://www.npmjs.com/package/wrollup

2cents

@talmobi I'll check that out.

Thanks for the assist!