You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Rspack has HMR already enabled by default. The guide only tells you how to disable it or run the dev server on a proxy server.
42
42
43
43
Requires the use of [`babel-loader`](https://www.npmjs.com/package/babel-loader). Add the following to `.babelrc`:
@@ -75,6 +75,42 @@ devServer: {
75
75
}
76
76
```
77
77
78
+
### Parcel
79
+
80
+
Add the following to `.babelrc`:
81
+
82
+
```json
83
+
{
84
+
"env": {
85
+
"development": {
86
+
"presets": [
87
+
["babel-preset-solid"]
88
+
],
89
+
"plugins": [
90
+
["module:solid-refresh/babel"]
91
+
]
92
+
},
93
+
"production": {
94
+
"presets": [
95
+
["babel-preset-solid"]
96
+
],
97
+
"plugins": [
98
+
]
99
+
}
100
+
}
101
+
}
102
+
```
103
+
104
+
Parcel doesn't enable package exports by default, which allows loading the dev version of SolidJS. To enable it, the following must be added in `package.json` (in accordance with [this document](https://parceljs.org/features/dependency-resolution/#enabling-package-exports)):
105
+
106
+
```json
107
+
{
108
+
"@parcel/resolver-default": {
109
+
"packageExports": true
110
+
}
111
+
}
112
+
```
113
+
78
114
### Nollup
79
115
80
116
Requires the use of [`@rollup/plugin-babel`](https://www.npmjs.com/package/@rollup/plugin-babel). Add the following to `.babelrc`:
@@ -105,8 +141,6 @@ Requires the use of [`@snowpack/plugin-babel`](https://www.npmjs.com/package/@sn
105
141
106
142
### Other dev servers
107
143
108
-
*[`Parcel`](https://parceljs.org/)
109
-
* ParcelJS doesn't support [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) yet, which makes ParcelJS load the production build of SolidJS instead of its development build. Solid Refresh requires the SolidJS development build to work.
110
144
*[`wmr`](https://wmr.dev/)
111
145
* SolidJS is yet to be supported or isn't clear yet. It will use the same config as Snowpack.
By default, components from the old module are replaced with the new ones from the replacement module, which might cause components that hasn't really changed to unmount abruptly.
163
-
164
-
Adding `@refresh granular` comment pragma in the file allows components to opt-in to granular replacement: If the component has changed *code-wise*, it will be replaced, otherwise, it will be retained, which allows unchanged ancestor components to preserve lifecycles.
165
-
166
194
## Limitations
167
195
168
-
* Preserving state: The default mode does not allow preserving state through module replacement. `@refresh granular` allows this partially.
0 commit comments