Skip to content

Commit

Permalink
docs: update package name (#3266)
Browse files Browse the repository at this point in the history
Co-authored-by: Rivaldo Junior <rivaldojunior@sas.com.br>
  • Loading branch information
rivajunior and Rivaldo Junior committed May 5, 2021
1 parent 4e8ffd8 commit 9438a9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-react-refresh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export default {
plugins: [reactRefresh({
parserPlugins: [
'classProperties',
'classPrivateProperties
'classPrivateProperties'
]
})]
}
```

[Full list of Babel parser plugins](https://babeljs.io/docs/en/babel-parser#ecmascript-proposalshttpsgithubcombabelproposals).

**Notes**
### Notes

- If using TSX, any TS-supported syntax will already be transpiled away so you won't need to specify them here.

Expand All @@ -38,11 +38,11 @@ export default {

## Middleware Mode Notes

When Vite is launched in **Middleware Mode**, you need to make sure your entry `index.html` file is transformed with `ViteDevServer.transformIndexHtml`. Otherwise, you may get an error prompting `Uncaught Error: vite-plugin-react can't detect preamble. Something is wrong.`
When Vite is launched in **Middleware Mode**, you need to make sure your entry `index.html` file is transformed with `ViteDevServer.transformIndexHtml`. Otherwise, you may get an error prompting `Uncaught Error: @vitejs/plugin-react-refresh can't detect preamble. Something is wrong.`

To mitigate this issue, you can explicitly transform your `index.html` like this when configuring your express server:

```ts
```js
app.get('/', async (req, res, next) => {
try {
let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-react-refresh/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ function reactRefreshPlugin(opts) {
if (!window.__vite_plugin_react_preamble_installed__) {
throw new Error(
"vite-plugin-react can't detect preamble. Something is wrong. " +
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
"@vitejs/plugin-react-refresh can't detect preamble. Something is wrong. " +
"See https://github.com/vitejs/@vitejs/plugin-react-refresh/pull/11#discussion_r430879201"
);
}
Expand Down

0 comments on commit 9438a9d

Please sign in to comment.