Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Watching? #5

@curran

Description

@curran

It would be awesome if changes made in transpiled packages were to cause the same automatic reloading as files changed within the /pages directory. It appears this case is considered in the plugin implementation, and has been iterated on in recent changes, but it is not working for me.

I have a reproduction case here: curran/nextjs-esm-example#4

Reproduction specifics:

  • Uses NextJS 7
  • Uses Lerna (symlinks)
  • Uses an Express app that invokes Next

Desired behavior:

  • The NextJS dev server should reload when you change files in the transpiled package.

Current behavior:

  • The NextJS dev server does not reload when you change files in the transpiled package (but it does reload if you change files locally).

I notice there's already something going on with watchOptions at https://github.com/martpie/next-plugin-transpile-modules/blob/master/index.js#L59, but I don't know enough about Webpack to assess why the reloading would not be working here.

I can confirm the webpackDevMiddleware is in fact getting set up, and the regex has been replaced.

console.log(ignored); from within the plugin yields the following:

[ /\.git/,
  /\.next\//,
  /node_modules(?!\/(some-es6-package)(?!.*node_modules))/ ]

Still, when I change a file inside /node_modules/some-es6-package/, the watcher does not catch the change.

P. S. Thanks for maintaining this plugin! It's super useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions