Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop using @rollup/plugin-url #101

Open
bastienrobert opened this issue Jul 6, 2020 · 4 comments
Open

Infinite loop using @rollup/plugin-url #101

bastienrobert opened this issue Jul 6, 2020 · 4 comments

Comments

@bastienrobert
Copy link

I'm getting an infinite loop when I'm using @rollup/plugin-url with Nollup (but not with Rollup).

  • @rollup/plugin-url 5.0.1
  • nollup 0.12.0
  • rollup 2.19.0

Here's a demo repository : nollup-url-infinite-loop

I tried too to downgrade but it's the same 😕

@PepsRyuu
Copy link
Owner

PepsRyuu commented Jul 6, 2020

Thanks for the repro! Infinite loop like that usually indicates that a plugin is writing to the disk, which causes the file watcher to trigger a rebuild. That seems to be the issue with @rollup/plugin-url, it's writing to disk using fs.

Ideally the plugin should be updated to the use the proper emitFile API, or change the plugin hook to writeBundle instead which makes more sense anyways than generateBundle.

As a temporary workaround, you can use the watch.exclude option to exclude the dist directory.

export default {
  input: `${src}/index.js`,
  output: {
    dir: dest,
    format: 'iife',
    entryFileNames: '[name].[hash].js',
    assetFileNames: '[name].[hash][extname]',
  },
  plugins: [url()],
  watch: {
    exclude: ['dist', 'node_modules', '.git']
  }
}

@bastienrobert
Copy link
Author

bastienrobert commented Jul 7, 2020

Woops, closing this too fast. I tried to exclude these folders as you specified. Repro has been updated but I still have the same issue :(

@bastienrobert bastienrobert reopened this Jul 7, 2020
@PepsRyuu
Copy link
Owner

PepsRyuu commented Jul 7, 2020

Hmmm, it works for me. Can't reproduce.

@peter-mouland
Copy link
Contributor

the suggested solution above didn't work for me, but passing in watch: 'src' as a nollup option (rather than in the rollup config) worked a treat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants