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.
It would be awesome if changes made in transpiled packages were to cause the same automatic reloading as files changed within the
/pagesdirectory. 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:
Desired behavior:
Current behavior:
I notice there's already something going on with
watchOptionsat 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
webpackDevMiddlewareis in fact getting set up, and the regex has been replaced.console.log(ignored);from within the plugin yields the following: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.