@@ -61,33 +61,36 @@ class ImportParserPlugin {
6161 mode = importOptions . webpackMode ;
6262 }
6363 }
64- if ( typeof importOptions . webpackPrefetchPriority !== "undefined" ) {
65- if ( typeof importOptions . webpackPrefetchPriority !== "number" ) {
64+ if ( typeof importOptions . webpackPrefetch !== "undefined" ) {
65+ if ( importOptions . webpackPrefetch === true ) {
66+ groupOptions . prefetchPriority = 0 ;
67+ } else if ( typeof importOptions . webpackPrefetch === "number" ) {
68+ groupOptions . prefetchPriority = importOptions . webpackPrefetch ;
69+ } else {
6670 parser . state . module . warnings . push (
6771 new UnsupportedFeatureWarning (
6872 parser . state . module ,
69- `\`webpackPrefetchPriority \` expected a number, but received: ${
70- importOptions . webpackPrefetchPriority
73+ `\`webpackPrefetch \` expected true or a number, but received: ${
74+ importOptions . webpackPrefetch
7175 } .`
7276 )
7377 ) ;
74- } else {
75- groupOptions . prefetchPriority =
76- importOptions . webpackPrefetchPriority ;
7778 }
7879 }
79- if ( typeof importOptions . webpackPreloadPriority !== "undefined" ) {
80- if ( typeof importOptions . webpackPreloadPriority !== "number" ) {
80+ if ( typeof importOptions . webpackPreload !== "undefined" ) {
81+ if ( importOptions . webpackPreload === true ) {
82+ groupOptions . preloadPriority = 0 ;
83+ } else if ( typeof importOptions . webpackPreload === "number" ) {
84+ groupOptions . preloadPriority = importOptions . webpackPreload ;
85+ } else {
8186 parser . state . module . warnings . push (
8287 new UnsupportedFeatureWarning (
8388 parser . state . module ,
84- `\`webpackPreloadPriority \` expected a number, but received: ${
85- importOptions . webpackPreloadPriority
89+ `\`webpackPreload \` expected true or a number, but received: ${
90+ importOptions . webpackPreload
8691 } .`
8792 )
8893 ) ;
89- } else {
90- groupOptions . preloadPriority = importOptions . webpackPreloadPriority ;
9194 }
9295 }
9396 if ( typeof importOptions . webpackInclude !== "undefined" ) {
0 commit comments