diff --git a/lib/runtime/AssetPrefetchPreloadRuntimeModule.js b/lib/runtime/AssetPrefetchPreloadRuntimeModule.js index 725797f39..03d10a460 100644 --- a/lib/runtime/AssetPrefetchPreloadRuntimeModule.js +++ b/lib/runtime/AssetPrefetchPreloadRuntimeModule.js @@ -49,9 +49,9 @@ class AssetPrefetchPreloadRuntimeModule extends RuntimeModule { // Add nonce if needed compilation.outputOptions.crossOriginLoading ? Template.asString([ - "if(__webpack_require__.nc) {", + `if(${RuntimeGlobals.scriptNonce}) {`, Template.indent( - "link.setAttribute('nonce', __webpack_require__.nc);" + `link.setAttribute('nonce', ${RuntimeGlobals.scriptNonce});` ), "}" ]) diff --git a/lib/url/URLParserPlugin.js b/lib/url/URLParserPlugin.js index 119b78832..bba3d4b4c 100644 --- a/lib/url/URLParserPlugin.js +++ b/lib/url/URLParserPlugin.js @@ -242,20 +242,6 @@ class URLParserPlugin { ); } - // Warn if both prefetch and preload are specified - if ( - importOptions.webpackPrefetch !== undefined && - importOptions.webpackPreload !== undefined - ) { - parser.state.module.addWarning( - new CommentCompilationWarning( - "Both webpackPrefetch and webpackPreload are specified. " + - "webpackPreload will take precedence for immediate loading.", - /** @type {DependencyLocation} */ (expr.loc) - ) - ); - } - // Store hints on the dependency for later use dep.prefetch = importOptions.webpackPrefetch; dep.preload = importOptions.webpackPreload;