rsnext/packages
Jiachi Liu 2a2890cae6
Fix esm module import warning for middleware loader (#51014)
We need to spread the module into an object instead of access the module exports that could not exist, to avoid triggering the warning. Fix the bad loader change introduced in #50548 

```
Attempted import error: './middleware.js' does not contain a default export (imported as '
mod').
- info Using locally built binary of @next/swc
- warn You are using an experimental edge runtime, the API might change.
- wait compiling...
- warn ../../../../packages/next/dist/build/webpack/loaders/next-middleware-loader.js?abso
lutePagePath=%2FUsers%2Fhuozhi%2Fworkspace%2Fnext.js%2Ftest%2Fe2e%2Fapp-dir%2Fapp%2Fmiddle
ware.js&page=%2Fmiddleware&rootDir=%2FUsers%2Fhuozhi%2Fworkspace%2Fnext.js%2Ftest%2Fe2e%2F
app-dir%2Fapp&matchers=!
Attempted import error: './middleware.js' does not contain a default export (imported as '
mod').
- wait compiling...
```
2023-06-09 14:14:50 +00:00
..
create-next-app v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
eslint-config-next v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
eslint-plugin-next v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
font v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next Fix esm module import warning for middleware loader (#51014) 2023-06-09 14:14:50 +00:00
next-bundle-analyzer v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-codemod v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-env v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-mdx v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-plugin-storybook v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-polyfill-module v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-polyfill-nomodule v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
next-swc v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
react-dev-overlay v13.4.5-canary.9 2023-06-09 08:30:52 +00:00
react-refresh-utils v13.4.5-canary.9 2023-06-09 08:30:52 +00:00