@next/react-refresh-utils
Advanced tools
Comparing version 9.4.5-canary.34 to 9.4.5-canary.35
{ | ||
"name": "@next/react-refresh-utils", | ||
"version": "9.4.5-canary.34", | ||
"version": "9.4.5-canary.35", | ||
"description": "An experimental package providing utilities for React Refresh.", | ||
@@ -28,3 +28,3 @@ "repository": { | ||
}, | ||
"gitHead": "ac7bee15893665b226cf47c317fa19317e198676" | ||
"gitHead": "b9f4bdfde3eb7f95359374631deda41e14ddce16" | ||
} |
@@ -6,4 +6,3 @@ "use strict"; | ||
function injectRefreshFunctions(compilation) { | ||
const hookVars = compilation | ||
.mainTemplate.hooks.localVars; | ||
const hookVars = compilation.mainTemplate.hooks.localVars; | ||
hookVars.tap('ReactFreshWebpackPlugin', (source) => webpack_1.Template.asString([ | ||
@@ -31,5 +30,5 @@ source, | ||
injectRefreshFunctions(compilation); | ||
const hookRequire = compilation | ||
.mainTemplate.hooks.require; | ||
hookRequire.tap('ReactFreshWebpackPlugin', (source, _chunk, _hash) => { | ||
const hookRequire = compilation.mainTemplate.hooks.require; | ||
// @ts-ignore webpack 5 types compat | ||
hookRequire.tap('ReactFreshWebpackPlugin', (source) => { | ||
// Webpack 4 evaluates module code on the following line: | ||
@@ -41,2 +40,3 @@ // ``` | ||
const lines = source.split('\n'); | ||
// @ts-ignore webpack 5 types compat | ||
const evalIndex = lines.findIndex((l) => l.includes('modules[moduleId].call(')); | ||
@@ -99,2 +99,3 @@ // Unable to find the module execution, that's OK: | ||
} | ||
// @ts-ignore webpack 5 types compat | ||
compiler.hooks.compilation.tap('ReactFreshWebpackPlugin', (compilation) => { | ||
@@ -101,0 +102,0 @@ injectRefreshFunctions(compilation); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21214
415