File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,11 @@ function injectRefreshLoader(data, matchObject) {
24
24
// Check to prevent double injection
25
25
! data . loaders . find ( ( { loader } ) => loader === resolvedLoader )
26
26
) {
27
- // It is important to have inject loader before anything,
28
- // especially if runtime transforms (e.g. @babel/plugin-transform-runtime) are being used.
29
- // Runtime transforms might make use of cache mechanisms (e.g. WeakMaps) to handle imports,
30
- // so if we do things out of their loop,
31
- // we might risk referencing a different version of the same dependency in the runtime.
32
- // This in its worst form will break HMR referential equality checks,
33
- // making us bail out on every change.
34
- // e.g. React in the file will not be equal to React as consumed by react-refresh.
35
- data . loaders . push ( {
27
+ // As we inject runtime code for each module,
28
+ // it is important to run the injected loader after everything.
29
+ // This way we can ensure that all code-processing have been done,
30
+ // and we won't risk breaking tools like Flow or ESLint.
31
+ data . loaders . unshift ( {
36
32
loader : resolvedLoader ,
37
33
options : undefined ,
38
34
} ) ;
You can’t perform that action at this time.
0 commit comments