rollup-plugin-react-refresh icon indicating copy to clipboard operation
rollup-plugin-react-refresh copied to clipboard

allow passing reactRefreshRuntimeFilePathRelativeToPlugin

Open vzaidman opened this issue 2 months ago • 0 comments

fixes https://github.com/PepsRyuu/rollup-plugin-react-refresh/issues/9.

The latest versions of Node.js force rollup-plugin-react-refresh to require react-refresh via a relative import. See https://nodejs.org/api/packages.html#main-entry-point-export for more details.

This PR allows passing a relative import path as a plugin's option, reactRefreshRuntimeFilePathRelativeToPlugin, and sets it to be a default that would work for most of the people:

- 'react-refresh/cjs/react-refresh-runtime.development.js'
+ const DEFAULT_REACT_REFRESH_PATH = '../react-refresh/cjs/react-refresh-runtime.development.js';

It also updates the readme, and adds an error in case there's a problem to resolve react-refresh-runtime.development.js.

vzaidman avatar Dec 28 '24 23:12 vzaidman