rollup-plugin-react-refresh
rollup-plugin-react-refresh copied to clipboard
allow passing reactRefreshRuntimeFilePathRelativeToPlugin
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
.