next 15.2.0-canary.65 → 15.2.0-canary.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of next might be problematic. Click here for more details.

Files changed (334) hide show
  1. package/dist/bin/next +5 -1
  2. package/dist/bin/next.map +1 -1
  3. package/dist/build/entries.d.ts +1 -0
  4. package/dist/build/entries.js +12 -1
  5. package/dist/build/entries.js.map +1 -1
  6. package/dist/build/index.js +3 -3
  7. package/dist/build/index.js.map +1 -1
  8. package/dist/build/swc/index.js +1 -1
  9. package/dist/build/webpack/config/blocks/base.js +3 -1
  10. package/dist/build/webpack/config/blocks/base.js.map +1 -1
  11. package/dist/build/webpack/config/blocks/css/index.js +3 -1
  12. package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
  13. package/dist/build/webpack/config/blocks/css/loaders/client.js +3 -1
  14. package/dist/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  15. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  16. package/dist/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  17. package/dist/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  18. package/dist/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  19. package/dist/build/webpack/loaders/next-flight-loader/index.js +8 -2
  20. package/dist/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  21. package/dist/build/webpack/loaders/utils.js +1 -1
  22. package/dist/build/webpack/loaders/utils.js.map +1 -1
  23. package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -1
  24. package/dist/build/webpack/plugins/build-manifest-plugin.js +13 -4
  25. package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  26. package/dist/build/webpack/plugins/flight-client-entry-plugin.d.ts +1 -1
  27. package/dist/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  28. package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  29. package/dist/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  30. package/dist/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  31. package/dist/build/webpack/plugins/middleware-plugin.js +6 -3
  32. package/dist/build/webpack/plugins/middleware-plugin.js.map +1 -1
  33. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  34. package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  35. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  36. package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  37. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.d.ts +36 -0
  38. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
  39. package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  40. package/dist/build/webpack/plugins/rspack-profiling-plugin.d.ts +9 -0
  41. package/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
  42. package/dist/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  43. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  44. package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  45. package/dist/build/webpack/utils.js +6 -2
  46. package/dist/build/webpack/utils.js.map +1 -1
  47. package/dist/build/webpack-config.js +37 -5
  48. package/dist/build/webpack-config.js.map +1 -1
  49. package/dist/client/app-bootstrap.js +1 -1
  50. package/dist/client/app-dir/link.js +2 -0
  51. package/dist/client/app-dir/link.js.map +1 -1
  52. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  53. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  54. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  55. package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  56. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.d.ts +1 -0
  57. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js +41 -0
  58. package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  59. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  60. package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  61. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  62. package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  63. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.d.ts +2 -0
  64. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +72 -0
  65. package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  66. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  67. package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  68. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  69. package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  70. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  71. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  72. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  73. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  74. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.d.ts +2 -1
  75. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +82 -31
  76. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  77. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.d.ts +2 -2
  78. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +20 -21
  79. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  80. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.d.ts +8 -0
  81. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +80 -0
  82. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  83. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.d.ts +9 -0
  84. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +158 -0
  85. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  86. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.d.ts +8 -0
  87. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +212 -0
  88. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  89. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.d.ts +1 -0
  90. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  91. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  92. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  93. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  94. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.d.ts +2 -2
  95. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  96. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  97. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.d.ts +2 -2
  98. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  99. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  100. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.d.ts +2 -2
  101. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  102. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  103. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  104. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  105. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.d.ts +2 -2
  106. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  107. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  108. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  109. package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  110. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  111. package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  112. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  113. package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  114. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.d.ts +2 -2
  115. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  116. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  117. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  118. package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  119. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  120. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  121. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.d.ts +1 -1
  122. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  123. package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  124. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  125. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  126. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.d.ts +1 -0
  127. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +34 -0
  128. package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  129. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  130. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  131. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  132. package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  133. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  134. package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  135. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +2 -2
  136. package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  137. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  138. package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  139. package/dist/client/components/react-dev-overlay/server/middleware-response.d.ts +9 -0
  140. package/dist/client/components/react-dev-overlay/server/middleware-response.js +46 -0
  141. package/dist/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  142. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +13 -12
  143. package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  144. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +12 -11
  145. package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  146. package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -7
  147. package/dist/client/components/react-dev-overlay/server/shared.js +1 -51
  148. package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
  149. package/dist/client/components/react-dev-overlay/shared.d.ts +1 -0
  150. package/dist/client/components/react-dev-overlay/shared.js +2 -0
  151. package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
  152. package/dist/client/index.js +2 -3
  153. package/dist/client/index.js.map +1 -1
  154. package/dist/client/link.js.map +1 -1
  155. package/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js +8 -44
  156. package/dist/compiled/@next/font/dist/google/fetch-font-file.d.ts +2 -1
  157. package/dist/compiled/@next/font/dist/google/fetch-font-file.js +6 -20
  158. package/dist/compiled/@next/font/dist/google/fetch-resource.d.ts +6 -0
  159. package/dist/compiled/@next/font/dist/google/fetch-resource.js +46 -0
  160. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
  161. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  162. package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
  163. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  164. package/dist/compiled/next-server/server.runtime.prod.js +2 -2
  165. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  166. package/dist/compiled/node-fetch/index.js +1 -1
  167. package/dist/compiled/sass-loader/cjs.js +1 -1
  168. package/dist/compiled/webpack/webpack.js +23 -1
  169. package/dist/esm/build/entries.js +9 -2
  170. package/dist/esm/build/entries.js.map +1 -1
  171. package/dist/esm/build/index.js +3 -3
  172. package/dist/esm/build/index.js.map +1 -1
  173. package/dist/esm/build/swc/index.js +1 -1
  174. package/dist/esm/build/webpack/config/blocks/base.js +3 -1
  175. package/dist/esm/build/webpack/config/blocks/base.js.map +1 -1
  176. package/dist/esm/build/webpack/config/blocks/css/index.js +3 -1
  177. package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
  178. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js +3 -1
  179. package/dist/esm/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
  180. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
  181. package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
  182. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
  183. package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
  184. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js +8 -2
  185. package/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
  186. package/dist/esm/build/webpack/loaders/utils.js +1 -1
  187. package/dist/esm/build/webpack/loaders/utils.js.map +1 -1
  188. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +14 -5
  189. package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
  190. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
  191. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  192. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js +3 -3
  193. package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
  194. package/dist/esm/build/webpack/plugins/middleware-plugin.js +6 -3
  195. package/dist/esm/build/webpack/plugins/middleware-plugin.js.map +1 -1
  196. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
  197. package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
  198. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
  199. package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
  200. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js +87 -0
  201. package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
  202. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js +40 -0
  203. package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
  204. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
  205. package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
  206. package/dist/esm/build/webpack/utils.js +6 -2
  207. package/dist/esm/build/webpack/utils.js.map +1 -1
  208. package/dist/esm/build/webpack-config.js +37 -5
  209. package/dist/esm/build/webpack-config.js.map +1 -1
  210. package/dist/esm/client/app-bootstrap.js +1 -1
  211. package/dist/esm/client/app-dir/link.js +2 -0
  212. package/dist/esm/client/app-dir/link.js.map +1 -1
  213. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
  214. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
  215. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
  216. package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
  217. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js +25 -0
  218. package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
  219. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
  220. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
  221. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
  222. package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
  223. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +54 -0
  224. package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
  225. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
  226. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
  227. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
  228. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
  229. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
  230. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  231. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
  232. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
  233. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +83 -31
  234. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
  235. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +13 -14
  236. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
  237. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +52 -0
  238. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
  239. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +130 -0
  240. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
  241. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +184 -0
  242. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
  243. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
  244. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
  245. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
  246. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
  247. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
  248. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
  249. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
  250. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
  251. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
  252. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
  253. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
  254. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
  255. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
  256. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
  257. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
  258. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
  259. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
  260. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
  261. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
  262. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
  263. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
  264. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
  265. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
  266. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
  267. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
  268. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
  269. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
  270. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
  271. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
  272. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
  273. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +18 -0
  274. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
  275. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
  276. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
  277. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
  278. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
  279. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
  280. package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
  281. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +1 -1
  282. package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
  283. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
  284. package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
  285. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js +30 -0
  286. package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
  287. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +14 -13
  288. package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
  289. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -12
  290. package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
  291. package/dist/esm/client/components/react-dev-overlay/server/shared.js +0 -26
  292. package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
  293. package/dist/esm/client/components/react-dev-overlay/shared.js +2 -0
  294. package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
  295. package/dist/esm/client/index.js +2 -3
  296. package/dist/esm/client/index.js.map +1 -1
  297. package/dist/esm/client/link.js.map +1 -1
  298. package/dist/esm/server/base-server.js +15 -15
  299. package/dist/esm/server/base-server.js.map +1 -1
  300. package/dist/esm/server/config-shared.js.map +1 -1
  301. package/dist/esm/server/config.js +1 -1
  302. package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -2
  303. package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
  304. package/dist/esm/server/dev/hot-reloader-webpack.js +4 -2
  305. package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
  306. package/dist/esm/server/lib/app-info-log.js +1 -1
  307. package/dist/esm/server/lib/start-server.js +1 -1
  308. package/dist/esm/shared/lib/get-rspack.js +32 -0
  309. package/dist/esm/shared/lib/get-rspack.js.map +1 -0
  310. package/dist/server/base-server.js +15 -15
  311. package/dist/server/base-server.js.map +1 -1
  312. package/dist/server/config-shared.d.ts +3 -3
  313. package/dist/server/config-shared.js.map +1 -1
  314. package/dist/server/config.js +1 -1
  315. package/dist/server/dev/hot-reloader-turbopack.js +4 -2
  316. package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
  317. package/dist/server/dev/hot-reloader-webpack.js +4 -2
  318. package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
  319. package/dist/server/lib/app-info-log.js +1 -1
  320. package/dist/server/lib/start-server.js +1 -1
  321. package/dist/shared/lib/get-rspack.d.ts +2 -0
  322. package/dist/shared/lib/get-rspack.js +54 -0
  323. package/dist/shared/lib/get-rspack.js.map +1 -0
  324. package/dist/telemetry/anonymous-meta.js +1 -1
  325. package/dist/telemetry/events/session-stopped.js +2 -2
  326. package/dist/telemetry/events/version.js +2 -2
  327. package/dist/trace/trace-uploader.js +1 -2
  328. package/dist/trace/trace-uploader.js.map +1 -1
  329. package/package.json +15 -15
  330. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.d.ts +0 -3
  331. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -43
  332. package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
  333. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -27
  334. package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
@@ -119,7 +119,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
119
119
  }
120
120
  return newObj;
121
121
  }
122
- const nextVersion = "15.2.0-canary.65";
122
+ const nextVersion = "15.2.0-canary.66";
123
123
  const ArchName = (0, _os.arch)();
124
124
  const PlatformName = (0, _os.platform)();
125
125
  function infoLog(...args) {
@@ -36,6 +36,8 @@ const base = (0, _lodashcurry.default)(function base(ctx, config) {
36
36
  if (ctx.isDevelopment) {
37
37
  if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {
38
38
  config.devtool = false;
39
+ } else if (process.env.NEXT_RSPACK) {
40
+ config.devtool = 'source-map';
39
41
  } else {
40
42
  // `eval-source-map` provides full-fidelity source maps for the
41
43
  // original source, including columns and original variable names.
@@ -67,7 +69,7 @@ const base = (0, _lodashcurry.default)(function base(ctx, config) {
67
69
  config.plugins.push(new _devtoolsignorelistplugin.default({
68
70
  shouldIgnorePath
69
71
  }));
70
- } else if (config.devtool === 'eval-source-map') {
72
+ } else if (config.devtool === 'eval-source-map' && !process.env.NEXT_RSPACK) {
71
73
  var _config_output;
72
74
  // We're using a fork of `eval-source-map`
73
75
  config.devtool = false;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/build/webpack/config/blocks/base.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { COMPILER_NAMES } from '../../../../shared/lib/constants'\nimport type { ConfigurationContext } from '../utils'\nimport DevToolsIgnorePlugin from '../../plugins/devtools-ignore-list-plugin'\nimport EvalSourceMapDevToolPlugin from '../../plugins/eval-source-map-dev-tool-plugin'\n\nfunction shouldIgnorePath(modulePath: string): boolean {\n return (\n modulePath.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n modulePath.includes('next/dist')\n )\n}\n\nexport const base = curry(function base(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n config.mode = ctx.isDevelopment ? 'development' : 'production'\n config.name = ctx.isServer\n ? ctx.isEdgeRuntime\n ? COMPILER_NAMES.edgeServer\n : COMPILER_NAMES.server\n : COMPILER_NAMES.client\n\n config.target = !ctx.targetWeb\n ? 'node18.17' // Same version defined in packages/next/package.json#engines\n : ctx.isEdgeRuntime\n ? ['web', 'es6']\n : ['web', 'es6']\n\n // https://webpack.js.org/configuration/devtool/#development\n if (ctx.isDevelopment) {\n if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {\n config.devtool = false\n } else {\n // `eval-source-map` provides full-fidelity source maps for the\n // original source, including columns and original variable names.\n // This is desirable so the in-browser debugger can correctly pause\n // and show scoped variables with their original names.\n config.devtool = 'eval-source-map'\n }\n } else {\n if (\n ctx.isEdgeRuntime ||\n (ctx.isServer && ctx.serverSourceMaps) ||\n // Enable browser sourcemaps:\n (ctx.productionBrowserSourceMaps && ctx.isClient)\n ) {\n config.devtool = 'source-map'\n config.plugins ??= []\n config.plugins.push(\n new DevToolsIgnorePlugin({\n // TODO: eval-source-map has different module paths than source-map.\n // We're currently not actually ignore listing anything.\n shouldIgnorePath,\n })\n )\n } else {\n config.devtool = false\n }\n }\n\n if (!config.module) {\n config.module = { rules: [] }\n }\n\n config.plugins ??= []\n if (config.devtool === 'source-map') {\n config.plugins.push(\n new DevToolsIgnorePlugin({\n shouldIgnorePath,\n })\n )\n } else if (config.devtool === 'eval-source-map') {\n // We're using a fork of `eval-source-map`\n config.devtool = false\n config.plugins.push(\n new EvalSourceMapDevToolPlugin({\n moduleFilenameTemplate: config.output?.devtoolModuleFilenameTemplate,\n shouldIgnorePath,\n })\n )\n }\n\n // TODO: add codemod for \"Should not import the named export\" with JSON files\n // config.module.strictExportPresence = !isWebpack5\n\n return config\n})\n"],"names":["base","shouldIgnorePath","modulePath","includes","curry","ctx","config","mode","isDevelopment","name","isServer","isEdgeRuntime","COMPILER_NAMES","edgeServer","server","client","target","targetWeb","process","env","__NEXT_TEST_MODE","__NEXT_TEST_WITH_DEVTOOL","devtool","serverSourceMaps","productionBrowserSourceMaps","isClient","plugins","push","DevToolsIgnorePlugin","module","rules","EvalSourceMapDevToolPlugin","moduleFilenameTemplate","output","devtoolModuleFilenameTemplate"],"mappings":";;;;+BAeaA;;;eAAAA;;;oEAfK;2BAEa;iFAEE;mFACM;;;;;;AAEvC,SAASC,iBAAiBC,UAAkB;IAC1C,OACEA,WAAWC,QAAQ,CAAC,mBACpB,2EAA2E;IAC3ED,WAAWC,QAAQ,CAAC;AAExB;AAEO,MAAMH,OAAOI,IAAAA,oBAAK,EAAC,SAASJ,KACjCK,GAAyB,EACzBC,MAA6B;IAE7BA,OAAOC,IAAI,GAAGF,IAAIG,aAAa,GAAG,gBAAgB;IAClDF,OAAOG,IAAI,GAAGJ,IAAIK,QAAQ,GACtBL,IAAIM,aAAa,GACfC,yBAAc,CAACC,UAAU,GACzBD,yBAAc,CAACE,MAAM,GACvBF,yBAAc,CAACG,MAAM;IAEzBT,OAAOU,MAAM,GAAG,CAACX,IAAIY,SAAS,GAC1B,YAAY,6DAA6D;OACzEZ,IAAIM,aAAa,GACf;QAAC;QAAO;KAAM,GACd;QAAC;QAAO;KAAM;IAEpB,4DAA4D;IAC5D,IAAIN,IAAIG,aAAa,EAAE;QACrB,IAAIU,QAAQC,GAAG,CAACC,gBAAgB,IAAI,CAACF,QAAQC,GAAG,CAACE,wBAAwB,EAAE;YACzEf,OAAOgB,OAAO,GAAG;QACnB,OAAO;YACL,+DAA+D;YAC/D,kEAAkE;YAClE,mEAAmE;YACnE,uDAAuD;YACvDhB,OAAOgB,OAAO,GAAG;QACnB;IACF,OAAO;QACL,IACEjB,IAAIM,aAAa,IAChBN,IAAIK,QAAQ,IAAIL,IAAIkB,gBAAgB,IACrC,6BAA6B;QAC5BlB,IAAImB,2BAA2B,IAAInB,IAAIoB,QAAQ,EAChD;YACAnB,OAAOgB,OAAO,GAAG;YACjBhB,OAAOoB,OAAO,KAAK,EAAE;YACrBpB,OAAOoB,OAAO,CAACC,IAAI,CACjB,IAAIC,iCAAoB,CAAC;gBACvB,oEAAoE;gBACpE,wDAAwD;gBACxD3B;YACF;QAEJ,OAAO;YACLK,OAAOgB,OAAO,GAAG;QACnB;IACF;IAEA,IAAI,CAAChB,OAAOuB,MAAM,EAAE;QAClBvB,OAAOuB,MAAM,GAAG;YAAEC,OAAO,EAAE;QAAC;IAC9B;IAEAxB,OAAOoB,OAAO,KAAK,EAAE;IACrB,IAAIpB,OAAOgB,OAAO,KAAK,cAAc;QACnChB,OAAOoB,OAAO,CAACC,IAAI,CACjB,IAAIC,iCAAoB,CAAC;YACvB3B;QACF;IAEJ,OAAO,IAAIK,OAAOgB,OAAO,KAAK,mBAAmB;YAKnBhB;QAJ5B,0CAA0C;QAC1CA,OAAOgB,OAAO,GAAG;QACjBhB,OAAOoB,OAAO,CAACC,IAAI,CACjB,IAAII,mCAA0B,CAAC;YAC7BC,sBAAsB,GAAE1B,iBAAAA,OAAO2B,MAAM,qBAAb3B,eAAe4B,6BAA6B;YACpEjC;QACF;IAEJ;IAEA,6EAA6E;IAC7E,mDAAmD;IAEnD,OAAOK;AACT"}
1
+ {"version":3,"sources":["../../../../../src/build/webpack/config/blocks/base.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { COMPILER_NAMES } from '../../../../shared/lib/constants'\nimport type { ConfigurationContext } from '../utils'\nimport DevToolsIgnorePlugin from '../../plugins/devtools-ignore-list-plugin'\nimport EvalSourceMapDevToolPlugin from '../../plugins/eval-source-map-dev-tool-plugin'\n\nfunction shouldIgnorePath(modulePath: string): boolean {\n return (\n modulePath.includes('node_modules') ||\n // Only relevant for when Next.js is symlinked e.g. in the Next.js monorepo\n modulePath.includes('next/dist')\n )\n}\n\nexport const base = curry(function base(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n config.mode = ctx.isDevelopment ? 'development' : 'production'\n config.name = ctx.isServer\n ? ctx.isEdgeRuntime\n ? COMPILER_NAMES.edgeServer\n : COMPILER_NAMES.server\n : COMPILER_NAMES.client\n\n config.target = !ctx.targetWeb\n ? 'node18.17' // Same version defined in packages/next/package.json#engines\n : ctx.isEdgeRuntime\n ? ['web', 'es6']\n : ['web', 'es6']\n\n // https://webpack.js.org/configuration/devtool/#development\n if (ctx.isDevelopment) {\n if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {\n config.devtool = false\n } else if (process.env.NEXT_RSPACK) {\n config.devtool = 'source-map'\n } else {\n // `eval-source-map` provides full-fidelity source maps for the\n // original source, including columns and original variable names.\n // This is desirable so the in-browser debugger can correctly pause\n // and show scoped variables with their original names.\n config.devtool = 'eval-source-map'\n }\n } else {\n if (\n ctx.isEdgeRuntime ||\n (ctx.isServer && ctx.serverSourceMaps) ||\n // Enable browser sourcemaps:\n (ctx.productionBrowserSourceMaps && ctx.isClient)\n ) {\n config.devtool = 'source-map'\n config.plugins ??= []\n config.plugins.push(\n new DevToolsIgnorePlugin({\n // TODO: eval-source-map has different module paths than source-map.\n // We're currently not actually ignore listing anything.\n shouldIgnorePath,\n })\n )\n } else {\n config.devtool = false\n }\n }\n\n if (!config.module) {\n config.module = { rules: [] }\n }\n\n config.plugins ??= []\n if (config.devtool === 'source-map') {\n config.plugins.push(\n new DevToolsIgnorePlugin({\n shouldIgnorePath,\n })\n )\n } else if (config.devtool === 'eval-source-map' && !process.env.NEXT_RSPACK) {\n // We're using a fork of `eval-source-map`\n config.devtool = false\n config.plugins.push(\n new EvalSourceMapDevToolPlugin({\n moduleFilenameTemplate: config.output?.devtoolModuleFilenameTemplate,\n shouldIgnorePath,\n })\n )\n }\n\n // TODO: add codemod for \"Should not import the named export\" with JSON files\n // config.module.strictExportPresence = !isWebpack5\n\n return config\n})\n"],"names":["base","shouldIgnorePath","modulePath","includes","curry","ctx","config","mode","isDevelopment","name","isServer","isEdgeRuntime","COMPILER_NAMES","edgeServer","server","client","target","targetWeb","process","env","__NEXT_TEST_MODE","__NEXT_TEST_WITH_DEVTOOL","devtool","NEXT_RSPACK","serverSourceMaps","productionBrowserSourceMaps","isClient","plugins","push","DevToolsIgnorePlugin","module","rules","EvalSourceMapDevToolPlugin","moduleFilenameTemplate","output","devtoolModuleFilenameTemplate"],"mappings":";;;;+BAeaA;;;eAAAA;;;oEAfK;2BAEa;iFAEE;mFACM;;;;;;AAEvC,SAASC,iBAAiBC,UAAkB;IAC1C,OACEA,WAAWC,QAAQ,CAAC,mBACpB,2EAA2E;IAC3ED,WAAWC,QAAQ,CAAC;AAExB;AAEO,MAAMH,OAAOI,IAAAA,oBAAK,EAAC,SAASJ,KACjCK,GAAyB,EACzBC,MAA6B;IAE7BA,OAAOC,IAAI,GAAGF,IAAIG,aAAa,GAAG,gBAAgB;IAClDF,OAAOG,IAAI,GAAGJ,IAAIK,QAAQ,GACtBL,IAAIM,aAAa,GACfC,yBAAc,CAACC,UAAU,GACzBD,yBAAc,CAACE,MAAM,GACvBF,yBAAc,CAACG,MAAM;IAEzBT,OAAOU,MAAM,GAAG,CAACX,IAAIY,SAAS,GAC1B,YAAY,6DAA6D;OACzEZ,IAAIM,aAAa,GACf;QAAC;QAAO;KAAM,GACd;QAAC;QAAO;KAAM;IAEpB,4DAA4D;IAC5D,IAAIN,IAAIG,aAAa,EAAE;QACrB,IAAIU,QAAQC,GAAG,CAACC,gBAAgB,IAAI,CAACF,QAAQC,GAAG,CAACE,wBAAwB,EAAE;YACzEf,OA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
34
34
  const _nonnullable = require("../../../../../lib/non-nullable");
35
35
  const _constants = require("../../../../../lib/constants");
36
+ const _getrspack = require("../../../../../shared/lib/get-rspack");
36
37
  function _interop_require_default(obj) {
37
38
  return obj && obj.__esModule ? obj : {
38
39
  default: obj
@@ -131,6 +132,7 @@ async function lazyPostCSS(rootDirectory, supportedBrowsers, disablePostcssPrese
131
132
  return postcssInstancePromise;
132
133
  }
133
134
  const css = (0, _lodashcurry.default)(async function css(ctx, config) {
135
+ const isRspack = Boolean(process.env.NEXT_RSPACK);
134
136
  const { prependData: sassPrependData, additionalData: sassAdditionalData, implementation: sassImplementation, ...sassOptions } = ctx.sassOptions;
135
137
  const lazyPostCSSInitializer = ()=>lazyPostCSS(ctx.rootDirectory, ctx.supportedBrowsers, ctx.experimental.disablePostcssPresetEnv, ctx.experimental.useLightningcss);
136
138
  const sassPreprocessors = [
@@ -538,7 +540,7 @@ const css = (0, _lodashcurry.default)(async function css(ctx, config) {
538
540
  // Enable full mini-css-extract-plugin hmr for prod mode pages or app dir
539
541
  if (ctx.isClient && (ctx.isProduction || ctx.hasAppDir)) {
540
542
  // Extract CSS as CSS file(s) in the client-side production bundle.
541
- const MiniCssExtractPlugin = require('../../../plugins/mini-css-extract-plugin').default;
543
+ const MiniCssExtractPlugin = isRspack ? (0, _getrspack.getRspackCore)().CssExtractRspackPlugin : require('../../../plugins/mini-css-extract-plugin').default;
542
544
  fns.push((0, _helpers.plugin)(// @ts-ignore webpack 5 compat
543
545
  new MiniCssExtractPlugin({
544
546
  filename: ctx.isProduction ? 'static/css/[contenthash].css' : 'static/css/[name].css',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/build/webpack/config/blocks/css/index.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { loader, plugin } from '../../helpers'\nimport { pipe } from '../../utils'\nimport type { ConfigurationContext, ConfigurationFn } from '../../utils'\nimport { getCssModuleLoader, getGlobalCssLoader } from './loaders'\nimport { getNextFontLoader } from './loaders/next-font'\nimport {\n getCustomDocumentError,\n getGlobalImportError,\n getGlobalModuleImportError,\n getLocalModuleImportError,\n} from './messages'\nimport { getPostCssPlugins } from './plugins'\nimport { nonNullable } from '../../../../../lib/non-nullable'\nimport { WEBPACK_LAYERS } from '../../../../../lib/constants'\n\n// RegExps for all Style Sheet variants\nexport const regexLikeCss = /\\.(css|scss|sass)$/\n\n// RegExps for Style Sheets\nconst regexCssGlobal = /(?<!\\.module)\\.css$/\nconst regexCssModules = /\\.module\\.css$/\n\n// RegExps for Syntactically Awesome Style Sheets\nconst regexSassGlobal = /(?<!\\.module)\\.(scss|sass)$/\nconst regexSassModules = /\\.module\\.(scss|sass)$/\n\nconst APP_LAYER_RULE = {\n or: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\nconst PAGES_LAYER_RULE = {\n not: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\n/**\n * Mark a rule as removable if built-in CSS support is disabled\n */\nfunction markRemovable(r: webpack.RuleSetRule): webpack.RuleSetRule {\n Object.defineProperty(r, Symbol.for('__next_css_remove'), {\n enumerable: false,\n value: true,\n })\n return r\n}\n\nlet postcssInstancePromise: Promise<any>\nexport async function lazyPostCSS(\n rootDirectory: string,\n supportedBrowsers: string[] | undefined,\n disablePostcssPresetEnv: boolean | undefined,\n useLightningcss: boolean | undefined\n) {\n if (!postcssInstancePromise) {\n postcssInstancePromise = (async () => {\n const postcss = require('postcss')\n // @ts-ignore backwards compat\n postcss.plugin = function postcssPlugin(name, initializer) {\n function creator(...args: any) {\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n // transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache: any\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n },\n })\n\n creator.process = function (\n css: any,\n processOpts: any,\n pluginOpts: any\n ) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n }\n\n // @ts-ignore backwards compat\n postcss.vendor = {\n /**\n * Returns the vendor prefix extracted from an input string.\n *\n * @example\n * postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'\n * postcss.vendor.prefix('tab-size') //=> ''\n */\n prefix: function prefix(prop: string): string {\n const match = prop.match(/^(-\\w+-)/)\n\n if (match) {\n return match[0]\n }\n\n return ''\n },\n\n /**\n * Returns the input string stripped of its vendor prefix.\n *\n * @example\n * postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'\n */\n unprefixed: function unprefixed(\n /**\n * String with or without vendor prefix.\n */\n prop: string\n ): string {\n return prop.replace(/^-\\w+-/, '')\n },\n }\n\n const postCssPlugins = await getPostCssPlugins(\n rootDirectory,\n supportedBrowsers,\n disablePostcssPresetEnv,\n useLightningcss\n )\n\n return {\n postcss,\n postcssWithPlugins: postcss(postCssPlugins),\n }\n })()\n }\n\n return postcssInstancePromise\n}\n\nexport const css = curry(async function css(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n const {\n prependData: sassPrependData,\n additionalData: sassAdditionalData,\n implementation: sassImplementation,\n ...sassOptions\n } = ctx.sassOptions\n\n const lazyPostCSSInitializer = () =>\n lazyPostCSS(\n ctx.rootDirectory,\n ctx.supportedBrowsers,\n ctx.experimental.disablePostcssPresetEnv,\n ctx.experimental.useLightningcss\n )\n\n const sassPreprocessors: webpack.RuleSetUseItem[] = [\n // First, process files with `sass-loader`: this inlines content, and\n // compiles away the proprietary syntax.\n {\n loader: require.resolve('next/dist/compiled/sass-loader'),\n options: {\n implementation: sassImplementation,\n // Source maps are required so that `resolve-url-loader` can locate\n // files original to their source directory.\n sourceMap: true,\n sassOptions: {\n // The \"fibers\" option is not needed for Node.js 16+, but it's causing\n // problems for Node.js <= 14 users as you'll have to manually install\n // the `fibers` package:\n // https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package\n // https://github.com/vercel/next.js/issues/45052\n // Since it's optional and not required, we'll disable it by default\n // to avoid the confusion.\n fibers: false,\n // TODO: Remove this once we upgrade to sass-loader 16\n silenceDeprecations: ['legacy-js-api'],\n ...sassOptions,\n },\n additionalData: sassPrependData || sassAdditionalData,\n },\n },\n // Then, `sass-loader` will have passed-through CSS imports as-is instead\n // of inlining them. Because they were inlined, the paths are no longer\n // correct.\n // To fix this, we use `resolve-url-loader` to rewrite the CSS\n // imports to real file paths.\n {\n loader: require.resolve('../../../loaders/resolve-url-loader/index'),\n options: {\n postcss: lazyPostCSSInitializer,\n // Source maps are not required here, but we may as well emit\n // them.\n sourceMap: true,\n },\n },\n ]\n\n const fns: ConfigurationFn[] = []\n\n const googleLoader = require.resolve(\n 'next/dist/compiled/@next/font/google/loader'\n )\n const localLoader = require.resolve(\n 'next/dist/compiled/@next/font/local/loader'\n )\n const nextFontLoaders: Array<[string | RegExp, string, any?]> = [\n [require.resolve('next/font/google/target.css'), googleLoader],\n [require.resolve('next/font/local/target.css'), localLoader],\n ]\n\n nextFontLoaders.forEach(([fontLoaderTarget, fontLoaderPath]) => {\n // Matches the resolved font loaders noop files to run next-font-loader\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: false,\n test: fontLoaderTarget,\n use: getNextFontLoader(ctx, lazyPostCSSInitializer, fontLoaderPath),\n }),\n ],\n })\n )\n })\n\n // CSS cannot be imported in _document. This comes before everything because\n // global CSS nor CSS modules work in said file.\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: regexLikeCss,\n // Use a loose regex so we don't have to crawl the file system to\n // find the real file name (if present).\n issuer: /pages[\\\\/]_document\\./,\n use: {\n loader: 'error-loader',\n options: {\n reason: getCustomDocumentError(),\n },\n },\n }),\n ],\n })\n )\n\n const shouldIncludeExternalCSSImports =\n !!ctx.experimental.craCompat || !!ctx.transpilePackages\n\n // CSS modules & SASS modules support. They are allowed to be imported in anywhere.\n fns.push(\n // CSS Modules should never have side effects. This setting will\n // allow unused CSS to be removed from the production build.\n // We ensure this by disallowing `:global()` CSS at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ].filter(nonNullable),\n }),\n // Opt-in support for Sass (using .scss or .sass extensions).\n // Sass Modules should never have side effects. This setting will\n // allow unused Sass to be removed from the production build.\n // We ensure this by disallowing `:global()` Sass at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n }),\n // Throw an error for CSS Modules used outside their supported scope\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssModules, regexSassModules],\n use: {\n loader: 'error-loader',\n options: {\n reason: getLocalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n\n // Global CSS and SASS support.\n if (ctx.isServer) {\n fns.push(\n loader({\n oneOf: [\n ctx.hasAppDir && !ctx.isProduction\n ? markRemovable({\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n issuerLayer: APP_LAYER_RULE,\n use: {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n })\n : null,\n markRemovable({\n // CSS imports have side effects, even on the server side.\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n use: require.resolve('next/dist/compiled/ignore-loader'),\n }),\n ].filter(nonNullable),\n })\n )\n } else {\n // External CSS files are allowed to be loaded when any of the following is true:\n // - hasAppDir: all CSS files are allowed\n // - If the CSS file is located in `node_modules`\n // - If the CSS file is located in another package in a monorepo (outside of the current rootDir)\n // - If the issuer is pages/_app (matched later)\n const allowedPagesGlobalCSSPath = ctx.hasAppDir\n ? undefined\n : {\n and: [\n {\n or: [\n /node_modules/,\n {\n not: [ctx.rootDirectory],\n },\n ],\n },\n ],\n }\n const allowedPagesGlobalCSSIssuer = ctx.hasAppDir\n ? undefined\n : shouldIncludeExternalCSSImports\n ? undefined\n : {\n and: [ctx.rootDirectory],\n not: [/node_modules/],\n }\n\n fns.push(\n loader({\n oneOf: [\n ...(ctx.hasAppDir\n ? [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n }),\n ]\n : []),\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n })\n )\n\n if (ctx.customAppFile) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ],\n }),\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ],\n })\n )\n }\n }\n\n // Throw an error for Global CSS used inside of `node_modules`\n if (!shouldIncludeExternalCSSImports) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: { and: [/node_modules/] },\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n }\n\n // Throw an error for Global CSS used outside of our custom <App> file\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: ctx.hasAppDir\n ? {\n // If it's inside the app dir, but not importing from a layout file,\n // throw an error.\n and: [ctx.rootDirectory],\n not: [/layout\\.(js|mjs|jsx|ts|tsx)$/],\n }\n : undefined,\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalImportError(),\n },\n },\n }),\n ],\n })\n )\n\n if (ctx.isClient) {\n // Automatically transform references to files (i.e. url()) into URLs\n // e.g. url(./logo.svg)\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n // This should only be applied to CSS files\n issuer: regexLikeCss,\n // Exclude extensions that webpack handles by default\n exclude: [\n /\\.(js|mjs|jsx|ts|tsx)$/,\n /\\.html$/,\n /\\.json$/,\n /\\.webpack\\[[^\\]]+\\]$/,\n ],\n // `asset/resource` always emits a URL reference, where `asset`\n // might inline the asset as a data URI\n type: 'asset/resource',\n }),\n ],\n })\n )\n }\n\n // Enable full mini-css-extract-plugin hmr for prod mode pages or app dir\n if (ctx.isClient && (ctx.isProduction || ctx.hasAppDir)) {\n // Extract CSS as CSS file(s) in the client-side production bundle.\n const MiniCssExtractPlugin =\n require('../../../plugins/mini-css-extract-plugin').default\n fns.push(\n plugin(\n // @ts-ignore webpack 5 compat\n new MiniCssExtractPlugin({\n filename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n chunkFilename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n // Next.js guarantees that CSS order \"doesn't matter\", due to imposed\n // restrictions:\n // 1. Global CSS can only be defined in a single entrypoint (_app)\n // 2. CSS Modules generate scoped class names by default and cannot\n // include Global CSS (:global() selector).\n //\n // While not a perfect guarantee (e.g. liberal use of `:global()`\n // selector), this assumption is required to code-split CSS.\n //\n // If this warning were to trigger, it'd be unactionable by the user,\n // but likely not valid -- so we disable it.\n ignoreOrder: true,\n insert: function (linkTag: HTMLLinkElement) {\n if (typeof _N_E_STYLE_LOAD === 'function') {\n const { href, onload, onerror } = linkTag\n _N_E_STYLE_LOAD(\n href.indexOf(window.location.origin) === 0\n ? new URL(href).pathname\n : href\n ).then(\n () => onload?.call(linkTag, { type: 'load' } as Event),\n () => onerror?.call(linkTag, {} as Event)\n )\n } else {\n document.head.appendChild(linkTag)\n }\n },\n })\n )\n )\n }\n\n const fn = pipe(...fns)\n return fn(config)\n})\n"],"names":["css","lazyPostCSS","regexLikeCss","regexCssGlobal","regexCssModules","regexSassGlobal","regexSassModules","APP_LAYER_RULE","or","WEBPACK_LAYERS","reactServerComponents","serverSideRendering","appPagesBrowser","PAGES_LAYER_RULE","not","markRemovable","r","Object","defineProperty","Symbol","for","enumerable","value","postcssInstancePromise","rootDirectory","supportedBrowsers","disablePostcssPresetEnv","useLightningcss","postcss","require","plugin","postcssPlugin","name","initializer","creator","args","transformer","cache","get","process","processOpts","pluginOpts","vendor","prefix","prop","match","unprefixed","replace","postCssPlugins","getPostCssPlugins","postcssWithPlugins","curry","ctx","config","prependData","sassPrependData","additionalData","sassAdditionalData","implementation","sassImplementation","sassOptions","lazyPostCSSInitializer","experimental","sassPreprocessors","loader","resolve","options","sourceMap","fibers","silenceDeprecations","fns","googleLoader","localLoader","nextFontLoaders","forEach","fontLoaderTarget","fontLoaderPath","push","oneOf","sideEffects","test","use","getNextFontLoader","issuer","reason","getCustomDocumentError","shouldIncludeExternalCSSImports","craCompat","transpilePackages","hasAppDir","issuerLayer","cssModules","getCssModuleLoader","isAppDir","filter","nonNullable","getLocalModuleImportError","isServer","isProduction","allowedPagesGlobalCSSPath","undefined","and","allowedPagesGlobalCSSIssuer","getGlobalCssLoader","include","customAppFile","getGlobalModuleImportError","getGlobalImportError","isClient","exclude","type","MiniCssExtractPlugin","default","filename","chunkFilename","ignoreOrder","insert","linkTag","_N_E_STYLE_LOAD","href","onload","onerror","indexOf","window","location","origin","URL","pathname","then","call","document","head","appendChild","fn","pipe"],"mappings":";;;;;;;;;;;;;;;;IAiJaA,GAAG;eAAHA;;IAzFSC,WAAW;eAAXA;;IAtCTC,YAAY;eAAZA;;;oEAlBK;yBAEa;uBACV;yBAEkC;0BACrB;0BAM3B;yBAC2B;6BACN;2BACG;;;;;;AAGxB,MAAMA,eAAe;AAE5B,2BAA2B;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C,IAAIqC,SAAS,AAAD,GAAI;QACvD,mEAAmE;QACnE,MAAMsB,uBACJlF,QAAQ,4CAA4CmF,OAAO;QAC7D1C,IAAIO,IAAI,CACN/C,IAAAA,eAAM,EACJ,8BAA8B;QAC9B,IAAIiF,qBAAqB;YACvBE,UAAU7D,IAAI8C,YAAY,GACtB,iCACA;YACJgB,eAAe9D,IAAI8C,YAAY,GAC3B,iCACA;YACJ,qEAAqE;YACrE,gBAAgB;YAChB,kEAAkE;YAClE,mEAAmE;YACnE,8CAA8C;YAC9C,EAAE;YACF,iEAAiE;YACjE,4DAA4D;YAC5D,EAAE;YACF,qEAAqE;YACrE,4CAA4C;YAC5CiB,aAAa;YACbC,QAAQ,SAAUC,OAAwB;gBACxC,IAAI,OAAOC,oBAAoB,YAAY;oBACzC,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGJ;oBAClCC,gBACEC,KAAKG,OAAO,CAACC,OAAOC,QAAQ,CAACC,MAAM,MAAM,IACrC,IAAIC,IAAIP,MAAMQ,QAAQ,GACtBR,MACJS,IAAI,CACJ,IAAMR,0BAAAA,OAAQS,IAAI,CAACZ,SAAS;4BAAEP,MAAM;wBAAO,IAC3C,IAAMW,2BAAAA,QAASQ,IAAI,CAACZ,SAAS,CAAC;gBAElC,OAAO;oBACLa,SAASC,IAAI,CAACC,WAAW,CAACf;gBAC5B;YACF;QACF;IAGN;IAEA,MAAMgB,KAAKC,IAAAA,WAAI,KAAIhE;IACnB,OAAO+D,GAAGhF;AACZ"}
1
+ {"version":3,"sources":["../../../../../../src/build/webpack/config/blocks/css/index.ts"],"sourcesContent":["import curry from 'next/dist/compiled/lodash.curry'\nimport type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { loader, plugin } from '../../helpers'\nimport { pipe } from '../../utils'\nimport type { ConfigurationContext, ConfigurationFn } from '../../utils'\nimport { getCssModuleLoader, getGlobalCssLoader } from './loaders'\nimport { getNextFontLoader } from './loaders/next-font'\nimport {\n getCustomDocumentError,\n getGlobalImportError,\n getGlobalModuleImportError,\n getLocalModuleImportError,\n} from './messages'\nimport { getPostCssPlugins } from './plugins'\nimport { nonNullable } from '../../../../../lib/non-nullable'\nimport { WEBPACK_LAYERS } from '../../../../../lib/constants'\nimport { getRspackCore } from '../../../../../shared/lib/get-rspack'\n\n// RegExps for all Style Sheet variants\nexport const regexLikeCss = /\\.(css|scss|sass)$/\n\n// RegExps for Style Sheets\nconst regexCssGlobal = /(?<!\\.module)\\.css$/\nconst regexCssModules = /\\.module\\.css$/\n\n// RegExps for Syntactically Awesome Style Sheets\nconst regexSassGlobal = /(?<!\\.module)\\.(scss|sass)$/\nconst regexSassModules = /\\.module\\.(scss|sass)$/\n\nconst APP_LAYER_RULE = {\n or: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\nconst PAGES_LAYER_RULE = {\n not: [\n WEBPACK_LAYERS.reactServerComponents,\n WEBPACK_LAYERS.serverSideRendering,\n WEBPACK_LAYERS.appPagesBrowser,\n ],\n}\n\n/**\n * Mark a rule as removable if built-in CSS support is disabled\n */\nfunction markRemovable(r: webpack.RuleSetRule): webpack.RuleSetRule {\n Object.defineProperty(r, Symbol.for('__next_css_remove'), {\n enumerable: false,\n value: true,\n })\n return r\n}\n\nlet postcssInstancePromise: Promise<any>\nexport async function lazyPostCSS(\n rootDirectory: string,\n supportedBrowsers: string[] | undefined,\n disablePostcssPresetEnv: boolean | undefined,\n useLightningcss: boolean | undefined\n) {\n if (!postcssInstancePromise) {\n postcssInstancePromise = (async () => {\n const postcss = require('postcss')\n // @ts-ignore backwards compat\n postcss.plugin = function postcssPlugin(name, initializer) {\n function creator(...args: any) {\n let transformer = initializer(...args)\n transformer.postcssPlugin = name\n // transformer.postcssVersion = new Processor().version\n return transformer\n }\n\n let cache: any\n Object.defineProperty(creator, 'postcss', {\n get() {\n if (!cache) cache = creator()\n return cache\n },\n })\n\n creator.process = function (\n css: any,\n processOpts: any,\n pluginOpts: any\n ) {\n return postcss([creator(pluginOpts)]).process(css, processOpts)\n }\n\n return creator\n }\n\n // @ts-ignore backwards compat\n postcss.vendor = {\n /**\n * Returns the vendor prefix extracted from an input string.\n *\n * @example\n * postcss.vendor.prefix('-moz-tab-size') //=> '-moz-'\n * postcss.vendor.prefix('tab-size') //=> ''\n */\n prefix: function prefix(prop: string): string {\n const match = prop.match(/^(-\\w+-)/)\n\n if (match) {\n return match[0]\n }\n\n return ''\n },\n\n /**\n * Returns the input string stripped of its vendor prefix.\n *\n * @example\n * postcss.vendor.unprefixed('-moz-tab-size') //=> 'tab-size'\n */\n unprefixed: function unprefixed(\n /**\n * String with or without vendor prefix.\n */\n prop: string\n ): string {\n return prop.replace(/^-\\w+-/, '')\n },\n }\n\n const postCssPlugins = await getPostCssPlugins(\n rootDirectory,\n supportedBrowsers,\n disablePostcssPresetEnv,\n useLightningcss\n )\n\n return {\n postcss,\n postcssWithPlugins: postcss(postCssPlugins),\n }\n })()\n }\n\n return postcssInstancePromise\n}\n\nexport const css = curry(async function css(\n ctx: ConfigurationContext,\n config: webpack.Configuration\n) {\n const isRspack = Boolean(process.env.NEXT_RSPACK)\n const {\n prependData: sassPrependData,\n additionalData: sassAdditionalData,\n implementation: sassImplementation,\n ...sassOptions\n } = ctx.sassOptions\n\n const lazyPostCSSInitializer = () =>\n lazyPostCSS(\n ctx.rootDirectory,\n ctx.supportedBrowsers,\n ctx.experimental.disablePostcssPresetEnv,\n ctx.experimental.useLightningcss\n )\n\n const sassPreprocessors: webpack.RuleSetUseItem[] = [\n // First, process files with `sass-loader`: this inlines content, and\n // compiles away the proprietary syntax.\n {\n loader: require.resolve('next/dist/compiled/sass-loader'),\n options: {\n implementation: sassImplementation,\n // Source maps are required so that `resolve-url-loader` can locate\n // files original to their source directory.\n sourceMap: true,\n sassOptions: {\n // The \"fibers\" option is not needed for Node.js 16+, but it's causing\n // problems for Node.js <= 14 users as you'll have to manually install\n // the `fibers` package:\n // https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package\n // https://github.com/vercel/next.js/issues/45052\n // Since it's optional and not required, we'll disable it by default\n // to avoid the confusion.\n fibers: false,\n // TODO: Remove this once we upgrade to sass-loader 16\n silenceDeprecations: ['legacy-js-api'],\n ...sassOptions,\n },\n additionalData: sassPrependData || sassAdditionalData,\n },\n },\n // Then, `sass-loader` will have passed-through CSS imports as-is instead\n // of inlining them. Because they were inlined, the paths are no longer\n // correct.\n // To fix this, we use `resolve-url-loader` to rewrite the CSS\n // imports to real file paths.\n {\n loader: require.resolve('../../../loaders/resolve-url-loader/index'),\n options: {\n postcss: lazyPostCSSInitializer,\n // Source maps are not required here, but we may as well emit\n // them.\n sourceMap: true,\n },\n },\n ]\n\n const fns: ConfigurationFn[] = []\n\n const googleLoader = require.resolve(\n 'next/dist/compiled/@next/font/google/loader'\n )\n const localLoader = require.resolve(\n 'next/dist/compiled/@next/font/local/loader'\n )\n const nextFontLoaders: Array<[string | RegExp, string, any?]> = [\n [require.resolve('next/font/google/target.css'), googleLoader],\n [require.resolve('next/font/local/target.css'), localLoader],\n ]\n\n nextFontLoaders.forEach(([fontLoaderTarget, fontLoaderPath]) => {\n // Matches the resolved font loaders noop files to run next-font-loader\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: false,\n test: fontLoaderTarget,\n use: getNextFontLoader(ctx, lazyPostCSSInitializer, fontLoaderPath),\n }),\n ],\n })\n )\n })\n\n // CSS cannot be imported in _document. This comes before everything because\n // global CSS nor CSS modules work in said file.\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: regexLikeCss,\n // Use a loose regex so we don't have to crawl the file system to\n // find the real file name (if present).\n issuer: /pages[\\\\/]_document\\./,\n use: {\n loader: 'error-loader',\n options: {\n reason: getCustomDocumentError(),\n },\n },\n }),\n ],\n })\n )\n\n const shouldIncludeExternalCSSImports =\n !!ctx.experimental.craCompat || !!ctx.transpilePackages\n\n // CSS modules & SASS modules support. They are allowed to be imported in anywhere.\n fns.push(\n // CSS Modules should never have side effects. This setting will\n // allow unused CSS to be removed from the production build.\n // We ensure this by disallowing `:global()` CSS at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexCssModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ].filter(nonNullable),\n }),\n // Opt-in support for Sass (using .scss or .sass extensions).\n // Sass Modules should never have side effects. This setting will\n // allow unused Sass to be removed from the production build.\n // We ensure this by disallowing `:global()` Sass at the top-level\n // via the `pure` mode in `css-loader`.\n loader({\n oneOf: [\n // For app dir, we need to match the specific app layer.\n ctx.hasAppDir\n ? markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: true,\n },\n },\n ...getCssModuleLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n })\n : null,\n markRemovable({\n sideEffects: true,\n test: regexSassModules,\n issuerLayer: PAGES_LAYER_RULE,\n use: getCssModuleLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n }),\n // Throw an error for CSS Modules used outside their supported scope\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssModules, regexSassModules],\n use: {\n loader: 'error-loader',\n options: {\n reason: getLocalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n\n // Global CSS and SASS support.\n if (ctx.isServer) {\n fns.push(\n loader({\n oneOf: [\n ctx.hasAppDir && !ctx.isProduction\n ? markRemovable({\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n issuerLayer: APP_LAYER_RULE,\n use: {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n })\n : null,\n markRemovable({\n // CSS imports have side effects, even on the server side.\n sideEffects: true,\n test: [regexCssGlobal, regexSassGlobal],\n use: require.resolve('next/dist/compiled/ignore-loader'),\n }),\n ].filter(nonNullable),\n })\n )\n } else {\n // External CSS files are allowed to be loaded when any of the following is true:\n // - hasAppDir: all CSS files are allowed\n // - If the CSS file is located in `node_modules`\n // - If the CSS file is located in another package in a monorepo (outside of the current rootDir)\n // - If the issuer is pages/_app (matched later)\n const allowedPagesGlobalCSSPath = ctx.hasAppDir\n ? undefined\n : {\n and: [\n {\n or: [\n /node_modules/,\n {\n not: [ctx.rootDirectory],\n },\n ],\n },\n ],\n }\n const allowedPagesGlobalCSSIssuer = ctx.hasAppDir\n ? undefined\n : shouldIncludeExternalCSSImports\n ? undefined\n : {\n and: [ctx.rootDirectory],\n not: [/node_modules/],\n }\n\n fns.push(\n loader({\n oneOf: [\n ...(ctx.hasAppDir\n ? [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer\n ),\n ],\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuerLayer: APP_LAYER_RULE,\n use: [\n {\n loader: require.resolve(\n '../../../loaders/next-flight-css-loader'\n ),\n options: {\n cssModules: false,\n },\n },\n ...getGlobalCssLoader(\n { ...ctx, isAppDir: true },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n ],\n }),\n ]\n : []),\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n include: allowedPagesGlobalCSSPath,\n issuer: allowedPagesGlobalCSSIssuer,\n issuerLayer: PAGES_LAYER_RULE,\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ].filter(nonNullable),\n })\n )\n\n if (ctx.customAppFile) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexCssGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer\n ),\n }),\n ],\n }),\n loader({\n oneOf: [\n markRemovable({\n sideEffects: true,\n test: regexSassGlobal,\n issuer: { and: [ctx.customAppFile] },\n use: getGlobalCssLoader(\n { ...ctx, isAppDir: false },\n lazyPostCSSInitializer,\n sassPreprocessors\n ),\n }),\n ],\n })\n )\n }\n }\n\n // Throw an error for Global CSS used inside of `node_modules`\n if (!shouldIncludeExternalCSSImports) {\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: { and: [/node_modules/] },\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalModuleImportError(),\n },\n },\n }),\n ],\n })\n )\n }\n\n // Throw an error for Global CSS used outside of our custom <App> file\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n test: [regexCssGlobal, regexSassGlobal],\n issuer: ctx.hasAppDir\n ? {\n // If it's inside the app dir, but not importing from a layout file,\n // throw an error.\n and: [ctx.rootDirectory],\n not: [/layout\\.(js|mjs|jsx|ts|tsx)$/],\n }\n : undefined,\n use: {\n loader: 'error-loader',\n options: {\n reason: getGlobalImportError(),\n },\n },\n }),\n ],\n })\n )\n\n if (ctx.isClient) {\n // Automatically transform references to files (i.e. url()) into URLs\n // e.g. url(./logo.svg)\n fns.push(\n loader({\n oneOf: [\n markRemovable({\n // This should only be applied to CSS files\n issuer: regexLikeCss,\n // Exclude extensions that webpack handles by default\n exclude: [\n /\\.(js|mjs|jsx|ts|tsx)$/,\n /\\.html$/,\n /\\.json$/,\n /\\.webpack\\[[^\\]]+\\]$/,\n ],\n // `asset/resource` always emits a URL reference, where `asset`\n // might inline the asset as a data URI\n type: 'asset/resource',\n }),\n ],\n })\n )\n }\n\n // Enable full mini-css-extract-plugin hmr for prod mode pages or app dir\n if (ctx.isClient && (ctx.isProduction || ctx.hasAppDir)) {\n // Extract CSS as CSS file(s) in the client-side production bundle.\n const MiniCssExtractPlugin = isRspack\n ? getRspackCore().CssExtractRspackPlugin\n : require('../../../plugins/mini-css-extract-plugin').default\n\n fns.push(\n plugin(\n // @ts-ignore webpack 5 compat\n new MiniCssExtractPlugin({\n filename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n chunkFilename: ctx.isProduction\n ? 'static/css/[contenthash].css'\n : 'static/css/[name].css',\n // Next.js guarantees that CSS order \"doesn't matter\", due to imposed\n // restrictions:\n // 1. Global CSS can only be defined in a single entrypoint (_app)\n // 2. CSS Modules generate scoped class names by default and cannot\n // include Global CSS (:global() selector).\n //\n // While not a perfect guarantee (e.g. liberal use of `:global()`\n // selector), this assumption is required to code-split CSS.\n //\n // If this warning were to trigger, it'd be unactionable by the user,\n // but likely not valid -- so we disable it.\n ignoreOrder: true,\n insert: function (linkTag: HTMLLinkElement) {\n if (typeof _N_E_STYLE_LOAD === 'function') {\n const { href, onload, onerror } = linkTag\n _N_E_STYLE_LOAD(\n href.indexOf(window.location.origin) === 0\n ? new URL(href).pathname\n : href\n ).then(\n () => onload?.call(linkTag, { type: 'load' } as Event),\n () => onerror?.call(linkTag, {} as Event)\n )\n } else {\n document.head.appendChild(linkTag)\n }\n },\n })\n )\n )\n }\n\n const fn = pipe(...fns)\n return fn(config)\n})\n"],"names":["css","lazyPostCSS","regexLikeCss","regexCssGlobal","regexCssModules","regexSassGlobal","regexSassModules","APP_LAYER_RULE","or","WEBPACK_LAYERS","reactServerComponents","serverSideRendering","appPagesBrowser","PAGES_LAYER_RULE","not","markRemovable","r","Object","defineProperty","Symbol","for","enumerable","value","postcssInstancePromise","rootDirectory","supportedBrowsers","disablePostcssPresetEnv","useLightningcss","postcss","require","plugin","postcssPlugin","name","initializer","creator","args","transformer","cache","get","process","processOpts","pluginOpts","vendor","prefix","prop","match","unprefixed","replace","postCssPlugins","getPostCssPlugins","postcssWithPlugins","curry","ctx","config","isRspack","Boolean","env","NEXT_RSPACK","prependData","sassPrependData","additionalData","sassAdditionalData","implementation","sassImplementation","sassOptions","lazyPostCSSInitializer","experimental","sassPreprocessors","loader","resolve","options","sourceMap","fibers","silenceDeprecations","fns","googleLoader","localLoader","nextFontLoaders","forEach","fontLoaderTarget","fontLoaderPath","push","oneOf","sideEffects","test","use","getNextFontLoader","issuer","reason","getCustomDocumentError","shouldIncludeExternalCSSImports","craCompat","transpilePackages","hasAppDir","issuerLayer","cssModules","getCssModuleLoader","isAppDir","filter","nonNullable","getLocalModuleImportError","isServer","isProduction","allowedPagesGlobalCSSPath","undefined","and","allowedPagesGlobalCSSIssuer","getGlobalCssLoader","include","customAppFile","getGlobalModuleImportError","getGlobalImportError","isClient","exclude","type","MiniCssExtractPlugin","getRspackCore","CssExtractRspackPlugin","default","filename","chunkFilename","ignoreOrder","insert","linkTag","_N_E_STYLE_LOAD","href","onload","onerror","indexOf","window","location","origin","URL","pathname","then","call","document","head","appendChild","fn","pipe"],"mappings":";;;;;;;;;;;;;;;;IAkJaA,GAAG;eAAHA;;IAzFSC,WAAW;eAAXA;;IAtCTC,YAAY;eAAZA;;;oEA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}
10
10
  });
11
+ const _getrspack = require("../../../../../../shared/lib/get-rspack");
11
12
  function getClientStyleLoader({ hasAppDir, isAppDir, isDevelopment, assetPrefix }) {
13
+ const isRspack = Boolean(process.env.NEXT_RSPACK);
12
14
  const shouldEnableApp = typeof isAppDir === 'boolean' ? isAppDir : hasAppDir;
13
15
  // Keep next-style-loader for development mode in `pages/`
14
16
  if (isDevelopment && !shouldEnableApp) {
@@ -34,7 +36,7 @@ function getClientStyleLoader({ hasAppDir, isAppDir, isDevelopment, assetPrefix
34
36
  }
35
37
  };
36
38
  }
37
- const MiniCssExtractPlugin = require('../../../../plugins/mini-css-extract-plugin').default;
39
+ const MiniCssExtractPlugin = isRspack ? (0, _getrspack.getRspackCore)().rspack.CssExtractRspackPlugin : require('../../../../plugins/mini-css-extract-plugin').default;
38
40
  return {
39
41
  loader: MiniCssExtractPlugin.loader,
40
42
  options: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/build/webpack/config/blocks/css/loaders/client.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\n\nexport function getClientStyleLoader({\n hasAppDir,\n isAppDir,\n isDevelopment,\n assetPrefix,\n}: {\n hasAppDir: boolean\n isAppDir?: boolean\n isDevelopment: boolean\n assetPrefix: string\n}): webpack.RuleSetUseItem {\n const shouldEnableApp = typeof isAppDir === 'boolean' ? isAppDir : hasAppDir\n\n // Keep next-style-loader for development mode in `pages/`\n if (isDevelopment && !shouldEnableApp) {\n return {\n loader: 'next-style-loader',\n options: {\n insert: function (element: Node) {\n // By default, style-loader injects CSS into the bottom\n // of <head>. This causes ordering problems between dev\n // and prod. To fix this, we render a <noscript> tag as\n // an anchor for the styles to be placed before. These\n // styles will be applied _before_ <style jsx global>.\n\n // These elements should always exist. If they do not,\n // this code should fail.\n var anchorElement = document.querySelector(\n '#__next_css__DO_NOT_USE__'\n )!\n var parentNode = anchorElement.parentNode! // Normally <head>\n\n // Each style tag should be placed right before our\n // anchor. By inserting before and not after, we do not\n // need to track the last inserted element.\n parentNode.insertBefore(element, anchorElement)\n },\n },\n }\n }\n\n const MiniCssExtractPlugin =\n require('../../../../plugins/mini-css-extract-plugin').default\n return {\n loader: MiniCssExtractPlugin.loader,\n options: {\n publicPath: `${assetPrefix}/_next/`,\n esModule: false,\n },\n }\n}\n"],"names":["getClientStyleLoader","hasAppDir","isAppDir","isDevelopment","assetPrefix","shouldEnableApp","loader","options","insert","element","anchorElement","document","querySelector","parentNode","insertBefore","MiniCssExtractPlugin","require","default","publicPath","esModule"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,qBAAqB,EACnCC,SAAS,EACTC,QAAQ,EACRC,aAAa,EACbC,WAAW,EAMZ;IACC,MAAMC,kBAAkB,OAAOH,aAAa,YAAYA,WAAWD;IAEnE,0DAA0D;IAC1D,IAAIE,iBAAiB,CAACE,iBAAiB;QACrC,OAAO;YACLC,QAAQ;YACRC,SAAS;gBACPC,QAAQ,SAAUC,OAAa;oBAC7B,uDAAuD;oBACvD,uDAAuD;oBACvD,uDAAuD;oBACvD,sDAAsD;oBACtD,sDAAsD;oBAEtD,sDAAsD;oBACtD,yBAAyB;oBACzB,IAAIC,gBAAgBC,SAASC,aAAa,CACxC;oBAEF,IAAIC,aAAaH,cAAcG,UAAU,AAAE,kBAAkB;;oBAE7D,mDAAmD;oBACnD,uDAAuD;oBACvD,2CAA2C;oBAC3CA,WAAWC,YAAY,CAACL,SAASC;gBACnC;YACF;QACF;IACF;IAEA,MAAMK,uBACJC,QAAQ,+CAA+CC,OAAO;IAChE,OAAO;QACLX,QAAQS,qBAAqBT,MAAM;QACnCC,SAAS;YACPW,YAAY,GAAGd,YAAY,OAAO,CAAC;YACnCe,UAAU;QACZ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../../../../src/build/webpack/config/blocks/css/loaders/client.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { getRspackCore } from '../../../../../../shared/lib/get-rspack'\n\nexport function getClientStyleLoader({\n hasAppDir,\n isAppDir,\n isDevelopment,\n assetPrefix,\n}: {\n hasAppDir: boolean\n isAppDir?: boolean\n isDevelopment: boolean\n assetPrefix: string\n}): webpack.RuleSetUseItem {\n const isRspack = Boolean(process.env.NEXT_RSPACK)\n const shouldEnableApp = typeof isAppDir === 'boolean' ? isAppDir : hasAppDir\n\n // Keep next-style-loader for development mode in `pages/`\n if (isDevelopment && !shouldEnableApp) {\n return {\n loader: 'next-style-loader',\n options: {\n insert: function (element: Node) {\n // By default, style-loader injects CSS into the bottom\n // of <head>. This causes ordering problems between dev\n // and prod. To fix this, we render a <noscript> tag as\n // an anchor for the styles to be placed before. These\n // styles will be applied _before_ <style jsx global>.\n\n // These elements should always exist. If they do not,\n // this code should fail.\n var anchorElement = document.querySelector(\n '#__next_css__DO_NOT_USE__'\n )!\n var parentNode = anchorElement.parentNode! // Normally <head>\n\n // Each style tag should be placed right before our\n // anchor. By inserting before and not after, we do not\n // need to track the last inserted element.\n parentNode.insertBefore(element, anchorElement)\n },\n },\n }\n }\n\n const MiniCssExtractPlugin = isRspack\n ? getRspackCore().rspack.CssExtractRspackPlugin\n : require('../../../../plugins/mini-css-extract-plugin').default\n\n return {\n loader: MiniCssExtractPlugin.loader,\n options: {\n publicPath: `${assetPrefix}/_next/`,\n esModule: false,\n },\n }\n}\n"],"names":["getClientStyleLoader","hasAppDir","isAppDir","isDevelopment","assetPrefix","isRspack","Boolean","process","env","NEXT_RSPACK","shouldEnableApp","loader","options","insert","element","anchorElement","document","querySelector","parentNode","insertBefore","MiniCssExtractPlugin","getRspackCore","rspack","CssExtractRspackPlugin","require","default","publicPath","esModule"],"mappings":";;;;+BAGgBA;;;eAAAA;;;2BAFc;AAEvB,SAASA,qBAAqB,EACnCC,SAAS,EACTC,QAAQ,EACRC,aAAa,EACbC,WAAW,EAMZ;IACC,MAAMC,WAAWC,QAAQC,QAAQC,GAAG,CAACC,WAAW;IAChD,MAAMC,kBAAkB,OAAOR,aAAa,YAAYA,WAAWD;IAEnE,0DAA0D;IAC1D,IAAIE,iBAAiB,CAACO,iBAAiB;QACrC,OAAO;YACLC,QAAQ;YACRC,SAAS;gBACPC,QAAQ,SAAUC,OAAa;oBAC7B,uDAAuD;oBACvD,uDAAuD;oBACvD,uDAAuD;oBACvD,sDAAsD;oBACtD,sDAAsD;oBAEtD,sDAAsD;oBACtD,yBAAyB;oBACzB,IAAIC,gBAAgBC,SAASC,aAAa,CACxC;oBAEF,IAAIC,aAAaH,cAAcG,UAAU,AAAE,kBAAkB;;oBAE7D,mDAAmD;oBACnD,uDAAuD;oBACvD,2CAA2C;oBAC3CA,WAAWC,YAAY,CAACL,SAASC;gBACnC;YACF;QACF;IACF;IAEA,MAAMK,uBAAuBf,WACzBgB,IAAAA,wBAAa,IAAGC,MAAM,CAACC,sBAAsB,GAC7CC,QAAQ,+CAA+CC,OAAO;IAElE,OAAO;QACLd,QAAQS,qBAAqBT,MAAM;QACnCC,SAAS;YACPc,YAAY,GAAGtB,YAAY,OAAO,CAAC;YACnCuB,UAAU;QACZ;IACF;AACF"}
@@ -35,6 +35,10 @@ function transformSource() {
35
35
  buildInfo.rsc = {
36
36
  type: _constants.RSC_MODULE_TYPES.client
37
37
  };
38
+ if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {
39
+ const rscModuleInformationJson = JSON.stringify(buildInfo.rsc);
40
+ return `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\n` + code;
41
+ }
38
42
  return code;
39
43
  }
40
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/loaders/next-flight-client-entry-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport {\n BARREL_OPTIMIZATION_PREFIX,\n RSC_MODULE_TYPES,\n} from '../../../shared/lib/constants'\nimport { getModuleBuildInfo } from './get-module-build-info'\nimport { regexCSS } from './utils'\n\n/**\n * { [client import path]: [exported names] }\n */\nexport type ClientComponentImports = Record<string, Set<string>>\nexport type CssImports = Record<string, string[]>\n\nexport type NextFlightClientEntryLoaderOptions = {\n modules: string[] | string\n /** This is transmitted as a string to `getOptions` */\n server: boolean | 'true' | 'false'\n}\n\nexport type FlightClientEntryModuleItem = {\n // module path\n request: string\n // imported identifiers\n ids: string[]\n}\n\nexport default function transformSource(\n this: webpack.LoaderContext<NextFlightClientEntryLoaderOptions>\n) {\n let { modules, server } = this.getOptions()\n const isServer = server === 'true'\n\n if (!Array.isArray(modules)) {\n modules = modules ? [modules] : []\n }\n\n const code = modules\n .map((x) => JSON.parse(x) as FlightClientEntryModuleItem)\n // Filter out CSS files in the SSR compilation\n .filter(({ request }) => (isServer ? !regexCSS.test(request) : true))\n .map(({ request, ids }: FlightClientEntryModuleItem) => {\n const importPath = JSON.stringify(\n request.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? request.replace(':', '!=!')\n : request\n )\n\n // When we cannot determine the export names, we use eager mode to include the whole module.\n // Otherwise, we use eager mode with webpackExports to only include the necessary exports.\n // If we have '*' in the ids, we include all the imports\n if (ids.length === 0 || ids.includes('*')) {\n return `import(/* webpackMode: \"eager\" */ ${importPath});\\n`\n } else {\n return `import(/* webpackMode: \"eager\", webpackExports: ${JSON.stringify(\n ids\n )} */ ${importPath});\\n`\n }\n })\n .join(';\\n')\n\n const buildInfo = getModuleBuildInfo(this._module!)\n\n buildInfo.rsc = {\n type: RSC_MODULE_TYPES.client,\n }\n\n return code\n}\n"],"names":["transformSource","modules","server","getOptions","isServer","Array","isArray","code","map","x","JSON","parse","filter","request","regexCSS","test","ids","importPath","stringify","startsWith","BARREL_OPTIMIZATION_PREFIX","replace","length","includes","join","buildInfo","getModuleBuildInfo","_module","rsc","type","RSC_MODULE_TYPES","client"],"mappings":";;;;+BA2BA;;;eAAwBA;;;2BAvBjB;oCAC4B;uBACV;AAqBV,SAASA;IAGtB,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAG,IAAI,CAACC,UAAU;IACzC,MAAMC,WAAWF,WAAW;IAE5B,IAAI,CAACG,MAAMC,OAAO,CAACL,UAAU;QAC3BA,UAAUA,UAAU;YAACA;SAAQ,GAAG,EAAE;IACpC;IAEA,MAAMM,OAAON,QACVO,GAAG,CAAC,CAACC,IAAMC,KAAKC,KAAK,CAACF,GACvB,8CAA8C;KAC7CG,MAAM,CAAC,CAAC,EAAEC,OAAO,EAAE,GAAMT,WAAW,CAACU,eAAQ,CAACC,IAAI,CAACF,WAAW,MAC9DL,GAAG,CAAC,CAAC,EAAEK,OAAO,EAAEG,GAAG,EAA+B;QACjD,MAAMC,aAAaP,KAAKQ,SAAS,CAC/BL,QAAQM,UAAU,CAACC,qCAA0B,IACzCP,QAAQQ,OAAO,CAAC,KAAK,SACrBR;QAGN,4FAA4F;QAC5F,0FAA0F;QAC1F,wDAAwD;QACxD,IAAIG,IAAIM,MAAM,KAAK,KAAKN,IAAIO,QAAQ,CAAC,MAAM;YACzC,OAAO,CAAC,kCAAkC,EAAEN,WAAW,IAAI,CAAC;QAC9D,OAAO;YACL,OAAO,CAAC,gDAAgD,EAAEP,KAAKQ,SAAS,CACtEF,KACA,IAAI,EAAEC,WAAW,IAAI,CAAC;QAC1B;IACF,GACCO,IAAI,CAAC;IAER,MAAMC,YAAYC,IAAAA,sCAAkB,EAAC,IAAI,CAACC,OAAO;IAEjDF,UAAUG,GAAG,GAAG;QACdC,MAAMC,2BAAgB,CAACC,MAAM;IAC/B;IAEA,OAAOxB;AACT"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/loaders/next-flight-client-entry-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport {\n BARREL_OPTIMIZATION_PREFIX,\n RSC_MODULE_TYPES,\n} from '../../../shared/lib/constants'\nimport { getModuleBuildInfo } from './get-module-build-info'\nimport { regexCSS } from './utils'\n\n/**\n * { [client import path]: [exported names] }\n */\nexport type ClientComponentImports = Record<string, Set<string>>\nexport type CssImports = Record<string, string[]>\n\nexport type NextFlightClientEntryLoaderOptions = {\n modules: string[] | string\n /** This is transmitted as a string to `getOptions` */\n server: boolean | 'true' | 'false'\n}\n\nexport type FlightClientEntryModuleItem = {\n // module path\n request: string\n // imported identifiers\n ids: string[]\n}\n\nexport default function transformSource(\n this: webpack.LoaderContext<NextFlightClientEntryLoaderOptions>\n) {\n let { modules, server } = this.getOptions()\n const isServer = server === 'true'\n\n if (!Array.isArray(modules)) {\n modules = modules ? [modules] : []\n }\n\n const code = modules\n .map((x) => JSON.parse(x) as FlightClientEntryModuleItem)\n // Filter out CSS files in the SSR compilation\n .filter(({ request }) => (isServer ? !regexCSS.test(request) : true))\n .map(({ request, ids }: FlightClientEntryModuleItem) => {\n const importPath = JSON.stringify(\n request.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? request.replace(':', '!=!')\n : request\n )\n\n // When we cannot determine the export names, we use eager mode to include the whole module.\n // Otherwise, we use eager mode with webpackExports to only include the necessary exports.\n // If we have '*' in the ids, we include all the imports\n if (ids.length === 0 || ids.includes('*')) {\n return `import(/* webpackMode: \"eager\" */ ${importPath});\\n`\n } else {\n return `import(/* webpackMode: \"eager\", webpackExports: ${JSON.stringify(\n ids\n )} */ ${importPath});\\n`\n }\n })\n .join(';\\n')\n\n const buildInfo = getModuleBuildInfo(this._module!)\n\n buildInfo.rsc = {\n type: RSC_MODULE_TYPES.client,\n }\n if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {\n const rscModuleInformationJson = JSON.stringify(buildInfo.rsc)\n return (\n `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\\n` +\n code\n )\n }\n\n return code\n}\n"],"names":["transformSource","modules","server","getOptions","isServer","Array","isArray","code","map","x","JSON","parse","filter","request","regexCSS","test","ids","importPath","stringify","startsWith","BARREL_OPTIMIZATION_PREFIX","replace","length","includes","join","buildInfo","getModuleBuildInfo","_module","rsc","type","RSC_MODULE_TYPES","client","process","env","BUILTIN_FLIGHT_CLIEN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AC3F5B;IAEJ;IAEA,OAAOA;AACT"}
@@ -25,6 +25,12 @@ const flightClientModuleLoader = function transformSource(source, sourceMap) {
25
25
  // Assign the RSC meta information to buildInfo.
26
26
  const buildInfo = (0, _getmodulebuildinfo.getModuleBuildInfo)(this._module);
27
27
  buildInfo.rsc = (0, _getpagestaticinfo.getRSCModuleInformation)(source, false);
28
+ let prefix = '';
29
+ if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {
30
+ const rscModuleInformationJson = JSON.stringify(buildInfo.rsc);
31
+ prefix = `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\n`;
32
+ source = prefix + source;
33
+ }
28
34
  // This is a server action entry module in the client layer. We need to
29
35
  // create re-exports of "virtual modules" to expose the reference IDs to the
30
36
  // client separately so they won't be always in the same one module which is
@@ -32,7 +38,7 @@ const flightClientModuleLoader = function transformSource(source, sourceMap) {
32
38
  // production mode. In development mode, we want to preserve the original
33
39
  // modules (as transformed by SWC) to ensure that source mapping works.
34
40
  if (buildInfo.rsc.actionIds && process.env.NODE_ENV === 'production') {
35
- return Object.entries(buildInfo.rsc.actionIds).map(([id, name])=>{
41
+ return prefix + Object.entries(buildInfo.rsc.actionIds).map(([id, name])=>{
36
42
  return `export { ${name} } from 'next-flight-server-reference-proxy-loader?id=${id}&name=${name}!'`;
37
43
  }).join('\n');
38
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/loaders/next-flight-client-module-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { getRSCModuleInformation } from '../../analysis/get-page-static-info'\nimport { getModuleBuildInfo } from './get-module-build-info'\n\nconst flightClientModuleLoader: webpack.LoaderDefinitionFunction =\n function transformSource(this, source: string, sourceMap: any) {\n // Avoid buffer to be consumed\n if (typeof source !== 'string') {\n throw new Error('Expected source to have been transformed to a string.')\n }\n\n if (!this._module) {\n return source\n }\n // Assign the RSC meta information to buildInfo.\n const buildInfo = getModuleBuildInfo(this._module)\n buildInfo.rsc = getRSCModuleInformation(source, false)\n\n // This is a server action entry module in the client layer. We need to\n // create re-exports of \"virtual modules\" to expose the reference IDs to the\n // client separately so they won't be always in the same one module which is\n // not splittable. This server action module tree shaking is only applied in\n // production mode. In development mode, we want to preserve the original\n // modules (as transformed by SWC) to ensure that source mapping works.\n if (buildInfo.rsc.actionIds && process.env.NODE_ENV === 'production') {\n return Object.entries(buildInfo.rsc.actionIds)\n .map(([id, name]) => {\n return `export { ${name} } from 'next-flight-server-reference-proxy-loader?id=${id}&name=${name}!'`\n })\n .join('\\n')\n }\n\n return this.callback(null, source, sourceMap)\n }\n\nexport default flightClientModuleLoader\n"],"names":["flightClientModuleLoader","transformSource","source","sourceMap","Error","_module","buildInfo","getModuleBuildInfo","rsc","getRSCModuleInformation","actionIds","process","env","NODE_ENV","Object","entries","map","id","name","join","callback"],"mappings":";;;;+BAmCA;;;eAAA;;;mCAlCwC;oCACL;AAEnC,MAAMA,2BACJ,SAASC,gBAAsBC,MAAc,EAAEC,SAAc;IAC3D,8BAA8B;IAC9B,IAAI,OAAOD,WAAW,UAAU;QAC9B,MAAM,qBAAkE,CAAlE,IAAIE,MAAM,0DAAV,qBAAA;mBAAA;wBAAA;0BAAA;QAAiE;IACzE;IAEA,IAAI,CAAC,IAAI,CAACC,OAAO,EAAE;QACjB,OAAOH;IACT;IACA,gDAAgD;IAChD,MAAMI,YAAYC,IAAAA,sCAAkB,EAAC,IAAI,CAACF,OAAO;IACjDC,UAAUE,GAAG,GAAGC,IAAAA,0CAAuB,EAACP,QAAQ;IAEhD,uEAAuE;IACvE,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAC5E,yEAAyE;IACzE,uEAAuE;IACvE,IAAII,UAAUE,GAAG,CAACE,SAAS,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACpE,OAAOC,OAAOC,OAAO,CAACT,UAAUE,GAAG,CAACE,SAAS,EAC1CM,GAAG,CAAC,CAAC,CAACC,IAAIC,KAAK;YACd,OAAO,CAAC,SAAS,EAAEA,KAAK,sDAAsD,EAAED,GAAG,MAAM,EAAEC,KAAK,EAAE,CAAC;QACrG,GACCC,IAAI,CAAC;IACV;IAEA,OAAO,IAAI,CAACC,QAAQ,CAAC,MAAMlB,QAAQC;AACrC;MAEF,WAAeH"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/loaders/next-flight-client-module-loader.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { getRSCModuleInformation } from '../../analysis/get-page-static-info'\nimport { getModuleBuildInfo } from './get-module-build-info'\n\nconst flightClientModuleLoader: webpack.LoaderDefinitionFunction =\n function transformSource(this, source: string, sourceMap: any) {\n // Avoid buffer to be consumed\n if (typeof source !== 'string') {\n throw new Error('Expected source to have been transformed to a string.')\n }\n\n if (!this._module) {\n return source\n }\n // Assign the RSC meta information to buildInfo.\n const buildInfo = getModuleBuildInfo(this._module)\n buildInfo.rsc = getRSCModuleInformation(source, false)\n let prefix = ''\n if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {\n const rscModuleInformationJson = JSON.stringify(buildInfo.rsc)\n prefix = `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\\n`\n source = prefix + source\n }\n\n // This is a server action entry module in the client layer. We need to\n // create re-exports of \"virtual modules\" to expose the reference IDs to the\n // client separately so they won't be always in the same one module which is\n // not splittable. This server action module tree shaking is only applied in\n // production mode. In development mode, we want to preserve the original\n // modules (as transformed by SWC) to ensure that source mapping works.\n if (buildInfo.rsc.actionIds && process.env.NODE_ENV === 'production') {\n return (\n prefix +\n Object.entries(buildInfo.rsc.actionIds)\n .map(([id, name]) => {\n return `export { ${name} } from 'next-flight-server-reference-proxy-loader?id=${id}&name=${name}!'`\n })\n .join('\\n')\n )\n }\n\n return this.callback(null, source, sourceMap)\n }\n\nexport default flightClientModuleLoader\n"],"names":["flightClientModuleLoader","transformSource","source","sourceMap","Error","_module","buildInfo","getModuleBuildInfo","rsc","getRSCModuleInformation","prefix","process","env","BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN","rscModuleInformationJson","JSON","stringify","actionIds","NODE_ENV","Object","entries","map","id","name","join","callback"],"mappings":";;;;+BA4CA;;;eAAA;;;mCA3CwC;oCACL;AAEnC,MAAMA,2BACJ,SAASC,gBAAsBC,MAAc,EAAEC,SAAc;IAC3D,8BAA8B;IAC9B,IAAI,OAAOD,WAAW,UAAU;QAC9B,MAAM,qBAAkE,CAAlE,IAAIE,MAAM,0DAAV,qBAAA;mBAAA;wBAAA;0BAAA;QAAiE;IACzE;IAEA,IAAI,CAAC,IAAI,CAACC,OAAO,EAAE;QACjB,OAAOH;IACT;IACA,gDAAgD;IAChD,MAAMI,YAAYC,IAAAA,sCAAkB,EAAC,IAAI,CAACF,OAAO;IACjDC,UAAUE,GAAG,GAAGC,IAAAA,0CAAuB,EAACP,QAAQ;IAChD,IAAIQ,SAAS;IACb,IAAIC,QAAQC,GAAG,CAACC,kCAAkC,EAAE;QAClD,MAAMC,2BAA2BC,KAAKC,SAAS,CAACV,UAAUE,GAAG;QAC7DE,SAAS,CAAC,yDAAyD,EAAEI,yBAAyB,KAAK,CAAC;QACpGZ,SAASQ,SAASR;IACpB;IAEA,uEAAuE;IACvE,4EAA4E;IAC5E,4EAA4E;IAC5E,4EAA4E;IAC5E,yEAAyE;IACzE,uEAAuE;IACvE,IAAII,UAAUE,GAAG,CAACS,SAAS,IAAIN,QAAQC,GAAG,CAACM,QAAQ,KAAK,cAAc;QACpE,OACER,SACAS,OAAOC,OAAO,CAACd,UAAUE,GAAG,CAACS,SAAS,EACnCI,GAAG,CAAC,CAAC,CAACC,IAAIC,KAAK;YACd,OAAO,CAAC,SAAS,EAAEA,KAAK,sDAAsD,EAAED,GAAG,MAAM,EAAEC,KAAK,EAAE,CAAC;QACrG,GACCC,IAAI,CAAC;IAEZ;IAEA,OAAO,IAAI,CAACC,QAAQ,CAAC,MAAMvB,QAAQC;AACrC;MAEF,WAAeH"}
@@ -69,6 +69,12 @@ function transformSource(source, sourceMap) {
69
69
  // Exclude next internal files which are not marked as client files
70
70
  const buildInfo = (0, _getmodulebuildinfo.getModuleBuildInfo)(module1);
71
71
  buildInfo.rsc = (0, _getpagestaticinfo.getRSCModuleInformation)(source, true);
72
+ let prefix = '';
73
+ if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {
74
+ const rscModuleInformationJson = JSON.stringify(buildInfo.rsc);
75
+ prefix = `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\n`;
76
+ source = prefix + source;
77
+ }
72
78
  // Resource key is the unique identifier for the resource. When RSC renders
73
79
  // a client module, that key is used to identify that module across all compiler
74
80
  // layers.
@@ -102,7 +108,7 @@ function transformSource(source, sourceMap) {
102
108
  }));
103
109
  return;
104
110
  }
105
- let esmSource = `\
111
+ let esmSource = prefix + `\
106
112
  import { registerClientReference } from "react-server-dom-webpack/server.edge";
107
113
  `;
108
114
  for (const ref of clientRefs){
@@ -128,7 +134,7 @@ ${JSON.stringify(ref)},
128
134
  }
129
135
  return this.callback(null, esmSource, sourceMap);
130
136
  } else if (assumedSourceType === 'commonjs') {
131
- let cjsSource = `\
137
+ let cjsSource = prefix + `\
132
138
  const { createProxy } = require("${MODULE_PROXY_PATH}")
133
139
 
134
140
  module.exports = createProxy(${stringifiedResourceKey})
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/index.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { RSC_MOD_REF_PROXY_ALIAS } from '../../../../lib/constants'\nimport {\n BARREL_OPTIMIZATION_PREFIX,\n RSC_MODULE_TYPES,\n} from '../../../../shared/lib/constants'\nimport { warnOnce } from '../../../../shared/lib/utils/warn-once'\nimport { getRSCModuleInformation } from '../../../analysis/get-page-static-info'\nimport { formatBarrelOptimizedResource } from '../../utils'\nimport { getModuleBuildInfo } from '../get-module-build-info'\nimport type {\n javascript,\n LoaderContext,\n} from 'next/dist/compiled/webpack/webpack'\n\ntype SourceType = javascript.JavascriptParser['sourceType'] | 'commonjs'\n\nconst noopHeadPath = require.resolve('next/dist/client/components/noop-head')\n// For edge runtime it will be aliased to esm version by webpack\nconst MODULE_PROXY_PATH =\n 'next/dist/build/webpack/loaders/next-flight-loader/module-proxy'\n\nexport function getAssumedSourceType(\n mod: webpack.Module,\n sourceType: SourceType\n): SourceType {\n const buildInfo = getModuleBuildInfo(mod)\n const detectedClientEntryType = buildInfo?.rsc?.clientEntryType\n const clientRefs = buildInfo?.rsc?.clientRefs || []\n\n // It's tricky to detect the type of a client boundary, but we should always\n // use the `module` type when we can, to support `export *` and `export from`\n // syntax in other modules that import this client boundary.\n\n if (sourceType === 'auto') {\n if (detectedClientEntryType === 'auto') {\n if (clientRefs.length === 0) {\n // If there's zero export detected in the client boundary, and it's the\n // `auto` type, we can safely assume it's a CJS module because it doesn't\n // have ESM exports.\n return 'commonjs'\n } else if (!clientRefs.includes('*')) {\n // Otherwise, we assume it's an ESM module.\n return 'module'\n }\n } else if (detectedClientEntryType === 'cjs') {\n return 'commonjs'\n }\n }\n\n return sourceType\n}\n\nexport default function transformSource(\n this: LoaderContext<undefined>,\n source: string,\n sourceMap: any\n) {\n // Avoid buffer to be consumed\n if (typeof source !== 'string') {\n throw new Error('Expected source to have been transformed to a string.')\n }\n\n const module = this._module!\n\n // Assign the RSC meta information to buildInfo.\n // Exclude next internal files which are not marked as client files\n const buildInfo = getModuleBuildInfo(module)\n buildInfo.rsc = getRSCModuleInformation(source, true)\n\n // Resource key is the unique identifier for the resource. When RSC renders\n // a client module, that key is used to identify that module across all compiler\n // layers.\n //\n // Usually it's the module's file path + the export name (e.g. `foo.js#bar`).\n // But with Barrel Optimizations, one file can be splitted into multiple modules,\n // so when you import `foo.js#bar` and `foo.js#baz`, they are actually different\n // \"foo.js\" being created by the Barrel Loader (one only exports `bar`, the other\n // only exports `baz`).\n //\n // Because of that, we must add another query param to the resource key to\n // differentiate them.\n let resourceKey: string = this.resourcePath\n if (module.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n resourceKey = formatBarrelOptimizedResource(\n resourceKey,\n module.matchResource\n )\n }\n\n // A client boundary.\n if (buildInfo.rsc?.type === RSC_MODULE_TYPES.client) {\n const assumedSourceType = getAssumedSourceType(\n module,\n (module.parser as javascript.JavascriptParser).sourceType\n )\n\n const clientRefs = buildInfo.rsc.clientRefs!\n const stringifiedResourceKey = JSON.stringify(resourceKey)\n\n if (assumedSourceType === 'module') {\n if (clientRefs.length === 0) {\n return this.callback(null, 'export {}')\n }\n\n if (clientRefs.includes('*')) {\n this.callback(\n new Error(\n `It's currently unsupported to use \"export *\" in a client boundary. Please use named exports instead.`\n )\n )\n return\n }\n\n let esmSource = `\\\nimport { registerClientReference } from \"react-server-dom-webpack/server.edge\";\n`\n for (const ref of clientRefs) {\n if (ref === 'default') {\n esmSource += `export default registerClientReference(\nfunction() { throw new Error(${JSON.stringify(`Attempted to call the default \\\nexport of ${stringifiedResourceKey} from the server, but it's on the client. \\\nIt's not possible to invoke a client function from the server, it can only be \\\nrendered as a Component or passed to props of a Client Component.`)}); },\n${stringifiedResourceKey},\n\"default\",\n);\\n`\n } else {\n esmSource += `export const ${ref} = registerClientReference(\nfunction() { throw new Error(${JSON.stringify(`Attempted to call ${ref}() from \\\nthe server but ${ref} is on the client. It's not possible to invoke a client \\\nfunction from the server, it can only be rendered as a Component or passed to \\\nprops of a Client Component.`)}); },\n${stringifiedResourceKey},\n${JSON.stringify(ref)},\n);`\n }\n }\n\n return this.callback(null, esmSource, sourceMap)\n } else if (assumedSourceType === 'commonjs') {\n let cjsSource = `\\\nconst { createProxy } = require(\"${MODULE_PROXY_PATH}\")\n\nmodule.exports = createProxy(${stringifiedResourceKey})\n`\n\n return this.callback(null, cjsSource, sourceMap)\n }\n }\n\n if (buildInfo.rsc?.type !== RSC_MODULE_TYPES.client) {\n if (noopHeadPath === this.resourcePath) {\n warnOnce(\n `Warning: You're using \\`next/head\\` inside the \\`app\\` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.`\n )\n }\n }\n\n const replacedSource = source.replace(\n RSC_MOD_REF_PROXY_ALIAS,\n MODULE_PROXY_PATH\n )\n this.callback(null, replacedSource, sourceMap)\n}\n"],"names":["transformSource","getAssumedSourceType","noopHeadPath","require","resolve","MODULE_PROXY_PATH","mod","sourceType","buildInfo","getModuleBuildInfo","detectedClientEntryType","rsc","clientEntryType","clientRefs","length","includes","source","sourceMap","module","Error","_module","getRSCModuleInformation","resourceKey","resourcePath","matchResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","type","RSC_MODULE_TYPES","client","assumedSourceType","parser","stringifiedResourceKey","JSON","stringify","callback","esmSource","ref","cjsSource","warnOnce","replacedSource","replace","RSC_MOD_REF_PROXY_ALIAS"],"mappings":";;;;;;;;;;;;;;;IAqDA,OA+GC;eA/GuBA;;IA/BRC,oBAAoB;eAApBA;;;2BArBwB;4BAIjC;0BACkB;mCACe;uBACM;oCACX;AAQnC,MAAMC,eAAeC,QAAQC,OAAO,CAAC;AACrC,gEAAgE;AAChE,MAAMC,oBACJ;AAEK,SAASJ,qBACdK,GAAmB,EACnBC,UAAsB;QAGUC,gBACbA;IAFnB,MAAMA,YAAYC,IAAAA,sCAAkB,EAACH;IACrC,MAAMI,0BAA0BF,8BAAAA,iBAAAA,UAAWG,GAAG,qBAAdH,eAAgBI,eAAe;IAC/D,MAAMC,aAAaL,CAAAA,8BAAAA,kBAAAA,UAAWG,GAAG,qBAAdH,gBAAgBK,UAAU,KAAI,EAAE;IAEnD,4EAA4E;IAC5E,6EAA6E;IAC7E,4DAA4D;IAE5D,IAAIN,eAAe,QAAQ;QACzB,IAAIG,4BAA4B,QAAQ;YACtC,IAAIG,WAAWC,MAAM,KAAK,GAAG;gBAC3B,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AAO0B,OAAO,CACnCC,kCAAuB,EACvBtC;IAEF,IAAI,CAAC+B,QAAQ,CAAC,MAAMK,gBAAgBxB;AACtC"}
1
+ {"version":3,"sources":["../../../../../src/build/webpack/loaders/next-flight-loader/index.ts"],"sourcesContent":["import type { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { RSC_MOD_REF_PROXY_ALIAS } from '../../../../lib/constants'\nimport {\n BARREL_OPTIMIZATION_PREFIX,\n RSC_MODULE_TYPES,\n} from '../../../../shared/lib/constants'\nimport { warnOnce } from '../../../../shared/lib/utils/warn-once'\nimport { getRSCModuleInformation } from '../../../analysis/get-page-static-info'\nimport { formatBarrelOptimizedResource } from '../../utils'\nimport { getModuleBuildInfo } from '../get-module-build-info'\nimport type {\n javascript,\n LoaderContext,\n} from 'next/dist/compiled/webpack/webpack'\n\ntype SourceType = javascript.JavascriptParser['sourceType'] | 'commonjs'\n\nconst noopHeadPath = require.resolve('next/dist/client/components/noop-head')\n// For edge runtime it will be aliased to esm version by webpack\nconst MODULE_PROXY_PATH =\n 'next/dist/build/webpack/loaders/next-flight-loader/module-proxy'\n\nexport function getAssumedSourceType(\n mod: webpack.Module,\n sourceType: SourceType\n): SourceType {\n const buildInfo = getModuleBuildInfo(mod)\n const detectedClientEntryType = buildInfo?.rsc?.clientEntryType\n const clientRefs = buildInfo?.rsc?.clientRefs || []\n\n // It's tricky to detect the type of a client boundary, but we should always\n // use the `module` type when we can, to support `export *` and `export from`\n // syntax in other modules that import this client boundary.\n\n if (sourceType === 'auto') {\n if (detectedClientEntryType === 'auto') {\n if (clientRefs.length === 0) {\n // If there's zero export detected in the client boundary, and it's the\n // `auto` type, we can safely assume it's a CJS module because it doesn't\n // have ESM exports.\n return 'commonjs'\n } else if (!clientRefs.includes('*')) {\n // Otherwise, we assume it's an ESM module.\n return 'module'\n }\n } else if (detectedClientEntryType === 'cjs') {\n return 'commonjs'\n }\n }\n\n return sourceType\n}\n\nexport default function transformSource(\n this: LoaderContext<undefined>,\n source: string,\n sourceMap: any\n) {\n // Avoid buffer to be consumed\n if (typeof source !== 'string') {\n throw new Error('Expected source to have been transformed to a string.')\n }\n const module = this._module!\n\n // Assign the RSC meta information to buildInfo.\n // Exclude next internal files which are not marked as client files\n const buildInfo = getModuleBuildInfo(module)\n buildInfo.rsc = getRSCModuleInformation(source, true)\n let prefix = ''\n if (process.env.BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN) {\n const rscModuleInformationJson = JSON.stringify(buildInfo.rsc)\n prefix = `/* __rspack_internal_rsc_module_information_do_not_use__ ${rscModuleInformationJson} */\\n`\n source = prefix + source\n }\n\n // Resource key is the unique identifier for the resource. When RSC renders\n // a client module, that key is used to identify that module across all compiler\n // layers.\n //\n // Usually it's the module's file path + the export name (e.g. `foo.js#bar`).\n // But with Barrel Optimizations, one file can be splitted into multiple modules,\n // so when you import `foo.js#bar` and `foo.js#baz`, they are actually different\n // \"foo.js\" being created by the Barrel Loader (one only exports `bar`, the other\n // only exports `baz`).\n //\n // Because of that, we must add another query param to the resource key to\n // differentiate them.\n let resourceKey: string = this.resourcePath\n if (module.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n resourceKey = formatBarrelOptimizedResource(\n resourceKey,\n module.matchResource\n )\n }\n\n // A client boundary.\n if (buildInfo.rsc?.type === RSC_MODULE_TYPES.client) {\n const assumedSourceType = getAssumedSourceType(\n module,\n (module.parser as javascript.JavascriptParser).sourceType\n )\n\n const clientRefs = buildInfo.rsc.clientRefs!\n const stringifiedResourceKey = JSON.stringify(resourceKey)\n\n if (assumedSourceType === 'module') {\n if (clientRefs.length === 0) {\n return this.callback(null, 'export {}')\n }\n\n if (clientRefs.includes('*')) {\n this.callback(\n new Error(\n `It's currently unsupported to use \"export *\" in a client boundary. Please use named exports instead.`\n )\n )\n return\n }\n\n let esmSource =\n prefix +\n `\\\nimport { registerClientReference } from \"react-server-dom-webpack/server.edge\";\n`\n for (const ref of clientRefs) {\n if (ref === 'default') {\n esmSource += `export default registerClientReference(\nfunction() { throw new Error(${JSON.stringify(`Attempted to call the default \\\nexport of ${stringifiedResourceKey} from the server, but it's on the client. \\\nIt's not possible to invoke a client function from the server, it can only be \\\nrendered as a Component or passed to props of a Client Component.`)}); },\n${stringifiedResourceKey},\n\"default\",\n);\\n`\n } else {\n esmSource += `export const ${ref} = registerClientReference(\nfunction() { throw new Error(${JSON.stringify(`Attempted to call ${ref}() from \\\nthe server but ${ref} is on the client. It's not possible to invoke a client \\\nfunction from the server, it can only be rendered as a Component or passed to \\\nprops of a Client Component.`)}); },\n${stringifiedResourceKey},\n${JSON.stringify(ref)},\n);`\n }\n }\n\n return this.callback(null, esmSource, sourceMap)\n } else if (assumedSourceType === 'commonjs') {\n let cjsSource =\n prefix +\n `\\\nconst { createProxy } = require(\"${MODULE_PROXY_PATH}\")\n\nmodule.exports = createProxy(${stringifiedResourceKey})\n`\n return this.callback(null, cjsSource, sourceMap)\n }\n }\n\n if (buildInfo.rsc?.type !== RSC_MODULE_TYPES.client) {\n if (noopHeadPath === this.resourcePath) {\n warnOnce(\n `Warning: You're using \\`next/head\\` inside the \\`app\\` directory, please migrate to the Metadata API. See https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#step-3-migrating-nexthead for more details.`\n )\n }\n }\n\n const replacedSource = source.replace(\n RSC_MOD_REF_PROXY_ALIAS,\n MODULE_PROXY_PATH\n )\n this.callback(null, replacedSource, sourceMap)\n}\n"],"names":["transformSource","getAssumedSourceType","noopHeadPath","require","resolve","MODULE_PROXY_PATH","mod","sourceType","buildInfo","getModuleBuildInfo","detectedClientEntryType","rsc","clientEntryType","clientRefs","length","includes","source","sourceMap","module","Error","_module","getRSCModuleInformation","prefix","process","env","BUILTIN_FLIGHT_CLIENT_ENTRY_PLUGIN","rscModuleInformationJson","JSON","stringify","resourceKey","resourcePath","matchResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","type","RSC_MODULE_TYPES","client","assumedSourceType","parser","stringifiedResourceKey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AAO9B,WAAY;gBAC5B,IAAI8B,QAAQ,WAAW;oBACrBD,aAAa,CAAC;6BACK,EAAEf,KAAKC,SAAS,CAAC,CAAC;UACrC,EAAEY,uBAAuB;;iEAE8B,CAAC,EAAE;AACpE,EAAEA,uBAAuB;;IAErB,CAAC;gBACG,OAAO;oBACLE,aAAa,CAAC,aAAa,EAAEC,IAAI;6BACd,EAAEhB,KAAKC,SAAS,CAAC,CAAC,kBAAkB,EAAEe,IAAI;eACxD,EAAEA,IAAI;;4BAEO,CAAC,EAAE;AAC/B,EAAEH,uBAAuB;AACzB,EAAEb,KAAKC,SAAS,CAACe,KAAK;EACpB,CAAC;gBACK;YACF;YAEA,OAAO,IAAI,CAACF,QAAQ,CAAC,MAAMC,WAAWzB;QACxC,OAAO,IAAIqB,sBAAsB,YAAY;YAC3C,IAAIM,YACFtB,SACA,CAAC;iCACwB,EAAEjB,kBAAkB;;6BAExB,EAAEmC,uBAAuB;AACtD,CAAC;YACK,OAAO,IAAI,CAACC,QAAQ,CAAC,MAAMG,WAAW3B;QACxC;IACF;IAEA,IAAIT,EAAAA,kBAAAA,UAAUG,GAAG,qBAAbH,gBAAe2B,IAAI,MAAKC,4BAAgB,CAACC,MAAM,EAAE;QACnD,IAAInC,iBAAiB,IAAI,CAAC4B,YAAY,EAAE;YACtCe,IAAAA,kBAAQ,EACN,CAAC,0OAA0O,CAAC;QAEhP;IACF;IAEA,MAAMC,iBAAiB9B,OAAO+B,OAAO,CACnCC,kCAAuB,EACvB3C;IAEF,IAAI,CAACoC,QAAQ,CAAC,MAAMK,gBAAgB7B;AACtC"}
@@ -62,7 +62,7 @@ function isClientComponentEntryModule(mod) {
62
62
  const regexCSS = /\.(css|scss|sass)(\?.*)?$/;
63
63
  function isCSSMod(mod) {
64
64
  var _mod_loaders;
65
- return !!(mod.type === 'css/mini-extract' || mod.resource && regexCSS.test(mod.resource) || ((_mod_loaders = mod.loaders) == null ? void 0 : _mod_loaders.some(({ loader })=>loader.includes('next-style-loader/index.js') || loader.includes('mini-css-extract-plugin/loader.js') || loader.includes('@vanilla-extract/webpack-plugin/loader/'))));
65
+ return !!(mod.type === 'css/mini-extract' || mod.resource && regexCSS.test(mod.resource) || ((_mod_loaders = mod.loaders) == null ? void 0 : _mod_loaders.some(({ loader })=>loader.includes('next-style-loader/index.js') || process.env.NEXT_RSPACK && loader.includes('rspack.CssExtractRspackPlugin.loader') || loader.includes('mini-css-extract-plugin/loader.js') || loader.includes('@vanilla-extract/webpack-plugin/loader/'))));
66
66
  }
67
67
  function encodeToBase64(obj) {
68
68
  return Buffer.from(JSON.stringify(obj)).toString('base64');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/build/webpack/loaders/utils.ts"],"sourcesContent":["import type webpack from 'webpack'\nimport { RSC_MODULE_TYPES } from '../../../shared/lib/constants'\nimport { getModuleBuildInfo } from './get-module-build-info'\n\nconst imageExtensions = ['jpg', 'jpeg', 'png', 'webp', 'avif', 'ico', 'svg']\nconst imageRegex = new RegExp(`\\\\.(${imageExtensions.join('|')})$`)\n\n// Determine if the whole module is client action, 'use server' in nested closure in the client module\nfunction isActionClientLayerModule(mod: webpack.NormalModule) {\n const rscInfo = getModuleBuildInfo(mod).rsc\n return !!(rscInfo?.actionIds && rscInfo?.type === RSC_MODULE_TYPES.client)\n}\n\nexport function isClientComponentEntryModule(mod: webpack.NormalModule) {\n const rscInfo = getModuleBuildInfo(mod).rsc\n const hasClientDirective = rscInfo?.isClientRef\n const isActionLayerEntry = isActionClientLayerModule(mod)\n return (\n hasClientDirective || isActionLayerEntry || imageRegex.test(mod.resource)\n )\n}\n\nexport const regexCSS = /\\.(css|scss|sass)(\\?.*)?$/\n\n// This function checks if a module is able to emit CSS resources. You should\n// never only rely on a single regex to do that.\nexport function isCSSMod(mod: {\n resource: string\n type?: string\n loaders?: { loader: string }[]\n}): boolean {\n return !!(\n mod.type === 'css/mini-extract' ||\n (mod.resource && regexCSS.test(mod.resource)) ||\n mod.loaders?.some(\n ({ loader }) =>\n loader.includes('next-style-loader/index.js') ||\n loader.includes('mini-css-extract-plugin/loader.js') ||\n loader.includes('@vanilla-extract/webpack-plugin/loader/')\n )\n )\n}\n\nexport function encodeToBase64<T extends object>(obj: T): string {\n return Buffer.from(JSON.stringify(obj)).toString('base64')\n}\n\nexport function decodeFromBase64<T extends object>(str: string): T {\n return JSON.parse(Buffer.from(str, 'base64').toString('utf8'))\n}\n\nexport async function getLoaderModuleNamedExports(\n resourcePath: string,\n context: webpack.LoaderContext<any>\n): Promise<string[]> {\n const mod = await new Promise<webpack.NormalModule>((res, rej) => {\n context.loadModule(\n resourcePath,\n (err: null | Error, _source: any, _sourceMap: any, module: any) => {\n if (err) {\n return rej(err)\n }\n res(module)\n }\n )\n })\n\n const exportNames =\n mod.dependencies\n ?.filter((dep) => {\n return (\n [\n 'HarmonyExportImportedSpecifierDependency',\n 'HarmonyExportSpecifierDependency',\n ].includes(dep.constructor.name) &&\n 'name' in dep &&\n dep.name !== 'default'\n )\n })\n .map((dep: any) => {\n return dep.name\n }) || []\n return exportNames\n}\n"],"names":["decodeFromBase64","encodeToBase64","getLoaderModuleNamedExports","isCSSMod","isClientComponentEntryModule","regexCSS","imageExtensions","imageRegex","RegExp","join","isActionClientLayerModule","mod","rscInfo","getModuleBuildInfo","rsc","actionIds","type","RSC_MODULE_TYPES","client","hasClientDirective","isClientRef","isActionLayerEntry","test","resource","loaders","some","loader","includes","obj","Buffer","from","JSON","stringify","toString","str","parse","resourcePath","context","Promise","res","rej","loadModule","err","_source","_sourceMap","module","exportNames","dependencies","filter","dep","constructor","name","map"],"mappings":";;;;;;;;;;;;;;;;;;;IA+CgBA,gBAAgB;eAAhBA;;IAJAC,cAAc;eAAdA;;IAQMC,2BAA2B;eAA3BA;;IAzBNC,QAAQ;eAARA;;IAbAC,4BAA4B;eAA5BA;;IASHC,QAAQ;eAARA;;;2BArBoB;oCACE;AAEnC,MAAMC,kBAAkB;IAAC;IAAO;IAAQ;IAAO;IAAQ;IAAQ;I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AAI2B,QAA8B,CAACC,KAAKC;QACxDH,QAAQI,UAAU,CAChBL,cACA,CAACM,KAAmBC,SAAcC,YAAiBC;YACjD,IAAIH,KAAK;gBACP,OAAOF,IAAIE;YACb;YACAH,IAAIM;QACN;IAEJ;IAEA,MAAMC,cACJnC,EAAAA,oBAAAA,IAAIoC,YAAY,qBAAhBpC,kBACIqC,MAAM,CAAC,CAACC;QACR,OACE;YACE;YACA;SACD,CAACtB,QAAQ,CAACsB,IAAIC,WAAW,CAACC,IAAI,KAC/B,UAAUF,OACVA,IAAIE,IAAI,KAAK;IAEjB,GACCC,GAAG,CAAC,CAACH;QACJ,OAAOA,IAAIE,IAAI;IACjB,OAAM,EAAE;IACZ,OAAOL;AACT"}
1
+ {"version":3,"sources":["../../../../src/build/webpack/loaders/utils.ts"],"sourcesContent":["import type webpack from 'webpack'\nimport { RSC_MODULE_TYPES } from '../../../shared/lib/constants'\nimport { getModuleBuildInfo } from './get-module-build-info'\n\nconst imageExtensions = ['jpg', 'jpeg', 'png', 'webp', 'avif', 'ico', 'svg']\nconst imageRegex = new RegExp(`\\\\.(${imageExtensions.join('|')})$`)\n\n// Determine if the whole module is client action, 'use server' in nested closure in the client module\nfunction isActionClientLayerModule(mod: webpack.NormalModule) {\n const rscInfo = getModuleBuildInfo(mod).rsc\n return !!(rscInfo?.actionIds && rscInfo?.type === RSC_MODULE_TYPES.client)\n}\n\nexport function isClientComponentEntryModule(mod: webpack.NormalModule) {\n const rscInfo = getModuleBuildInfo(mod).rsc\n const hasClientDirective = rscInfo?.isClientRef\n const isActionLayerEntry = isActionClientLayerModule(mod)\n return (\n hasClientDirective || isActionLayerEntry || imageRegex.test(mod.resource)\n )\n}\n\nexport const regexCSS = /\\.(css|scss|sass)(\\?.*)?$/\n\n// This function checks if a module is able to emit CSS resources. You should\n// never only rely on a single regex to do that.\nexport function isCSSMod(mod: {\n resource: string\n type?: string\n loaders?: { loader: string }[]\n}): boolean {\n return !!(\n mod.type === 'css/mini-extract' ||\n (mod.resource && regexCSS.test(mod.resource)) ||\n mod.loaders?.some(\n ({ loader }) =>\n loader.includes('next-style-loader/index.js') ||\n (process.env.NEXT_RSPACK &&\n loader.includes('rspack.CssExtractRspackPlugin.loader')) ||\n loader.includes('mini-css-extract-plugin/loader.js') ||\n loader.includes('@vanilla-extract/webpack-plugin/loader/')\n )\n )\n}\n\nexport function encodeToBase64<T extends object>(obj: T): string {\n return Buffer.from(JSON.stringify(obj)).toString('base64')\n}\n\nexport function decodeFromBase64<T extends object>(str: string): T {\n return JSON.parse(Buffer.from(str, 'base64').toString('utf8'))\n}\n\nexport async function getLoaderModuleNamedExports(\n resourcePath: string,\n context: webpack.LoaderContext<any>\n): Promise<string[]> {\n const mod = await new Promise<webpack.NormalModule>((res, rej) => {\n context.loadModule(\n resourcePath,\n (err: null | Error, _source: any, _sourceMap: any, module: any) => {\n if (err) {\n return rej(err)\n }\n res(module)\n }\n )\n })\n\n const exportNames =\n mod.dependencies\n ?.filter((dep) => {\n return (\n [\n 'HarmonyExportImportedSpecifierDependency',\n 'HarmonyExportSpecifierDependency',\n ].includes(dep.constructor.name) &&\n 'name' in dep &&\n dep.name !== 'default'\n )\n })\n .map((dep: any) => {\n return dep.name\n }) || []\n return exportNames\n}\n"],"names":["decodeFromBase64","encodeToBase64","getLoaderModuleNamedExports","isCSSMod","isClientComponentEntryModule","regexCSS","imageExtensions","imageRegex","RegExp","join","isActionClientLayerModule","mod","rscInfo","getModuleBuildInfo","rsc","actionIds","type","RSC_MODULE_TYPES","client","hasClientDirective","isClientRef","isActionLayerEntry","test","resource","loaders","some","loader","includes","process","env","NEXT_RSPACK","obj","Buffer","from","JSON","stringify","toString","str","parse","resourcePath","context","Promise","res","rej","loadModule","err","_source","_sourceMap","module","exportNames","dependencies","filter","dep","constructor","name","map"],"mappings":";;;;;;;;;;;;;;;;;;;IAiDgBA,gBAAgB;eAAhBA;;IAJAC,cAAc;eAAdA;;IAQMC,2BAA2B;eAA3BA;;IA3BNC,QAAQ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AAEO,SAASpC,iBAAmCqC,GAAW;IAC5D,OAAOH,KAAKI,KAAK,CAACN,OAAOC,IAAI,CAACI,KAAK,UAAUD,QAAQ,CAAC;AACxD;AAEO,eAAelC,4BACpBqC,YAAoB,EACpBC,OAAmC;QAejC7B;IAbF,MAAMA,MAAM,MAAM,IAAI8B,QAA8B,CAACC,KAAKC;QACxDH,QAAQI,UAAU,CAChBL,cACA,CAACM,KAAmBC,SAAcC,YAAiBC;YACjD,IAAIH,KAAK;gBACP,OAAOF,IAAIE;YACb;YACAH,IAAIM;QACN;IAEJ;IAEA,MAAMC,cACJtC,EAAAA,oBAAAA,IAAIuC,YAAY,qBAAhBvC,kBACIwC,MAAM,CAAC,CAACC;QACR,OACE;YACE;YACA;SACD,CAACzB,QAAQ,CAACyB,IAAIC,WAAW,CAACC,IAAI,KAC/B,UAAUF,OACVA,IAAIE,IAAI,KAAK;IAEjB,GACCC,GAAG,CAAC,CAACH;QACJ,OAAOA,IAAIE,IAAI;IACjB,OAAM,EAAE;IACZ,OAAOL;AACT"}
@@ -34,6 +34,6 @@ export default class BuildManifestPlugin {
34
34
  appDirEnabled: boolean;
35
35
  clientRouterFilters?: Parameters<typeof generateClientManifest>[2];
36
36
  });
37
- createAssets(compiler: any, compilation: any): void | undefined;
37
+ createAssets(compiler: any, compilation: any): void;
38
38
  apply(compiler: webpack.Compiler): void;
39
39
  }
@@ -45,12 +45,14 @@ const _getroutefromentrypoint = /*#__PURE__*/ _interop_require_default(require("
45
45
  const _nextdropclientpageplugin = require("./next-drop-client-page-plugin");
46
46
  const _utils = require("../../../shared/lib/router/utils");
47
47
  const _profilingplugin = require("./profiling-plugin");
48
+ const _rspackprofilingplugin = require("./rspack-profiling-plugin");
48
49
  const _trace = require("../../../trace");
49
50
  function _interop_require_default(obj) {
50
51
  return obj && obj.__esModule ? obj : {
51
52
  default: obj
52
53
  };
53
54
  }
55
+ const compilationSpans = process.env.NEXT_RSPACK ? _rspackprofilingplugin.compilationSpans : _profilingplugin.spans;
54
56
  const srcEmptySsgManifest = `self.__SSG_MANIFEST=new Set;self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB()`;
55
57
  // nodejs: '/static/<build id>/low-priority.js'
56
58
  function buildNodejsLowPriorityPath(filename, buildId) {
@@ -91,7 +93,7 @@ function normalizeRewritesForBuildManifest(rewrites) {
91
93
  };
92
94
  }
93
95
  function generateClientManifest(assetMap, rewrites, clientRouterFilters, compiler, compilation) {
94
- const compilationSpan = compilation ? _profilingplugin.spans.get(compilation) : compiler ? _profilingplugin.spans.get(compiler) : new _trace.Span({
96
+ const compilationSpan = compilation ? compilationSpans.get(compilation) : compiler ? compilationSpans.get(compiler) : new _trace.Span({
95
97
  name: 'client-manifest'
96
98
  });
97
99
  const genClientManifestSpan = compilationSpan == null ? void 0 : compilationSpan.traceChild('NextJsBuildManifest-generateClientManifest');
@@ -154,9 +156,16 @@ class BuildManifestPlugin {
154
156
  this.rewrites.fallback = options.rewrites.fallback.map(processRoute);
155
157
  }
156
158
  createAssets(compiler, compilation) {
157
- const compilationSpan = _profilingplugin.spans.get(compilation) || _profilingplugin.spans.get(compiler);
158
- const createAssetsSpan = compilationSpan == null ? void 0 : compilationSpan.traceChild('NextJsBuildManifest-createassets');
159
- return createAssetsSpan == null ? void 0 : createAssetsSpan.traceFn(()=>{
159
+ const compilationSpan = compilationSpans.get(compilation) ?? compilationSpans.get(compiler);
160
+ if (!compilationSpan) {
161
+ throw Object.defineProperty(new Error('No span found for compilation'), "__NEXT_ERROR_CODE", {
162
+ value: "E646",
163
+ enumerable: false,
164
+ configurable: true
165
+ });
166
+ }
167
+ const createAssetsSpan = compilationSpan.traceChild('NextJsBuildManifest-createassets');
168
+ return createAssetsSpan.traceFn(()=>{
160
169
  const entrypoints = compilation.entrypoints;
161
170
  const assetMap = {
162
171
  polyfillFiles: [],