Skip to content

Commit

Permalink
Add missing file in mini-css-extract-plugin (#25691)
Browse files Browse the repository at this point in the history
Adds the `hmr/hotModuleReplacement.js` file to the compiled output
that is used in
`packages/next/build/webpack/plugins/mini-css-extract-plugin.ts`.

Fixes #25560



## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
  • Loading branch information
TxHawks and ijjk authored May 23, 2022
1 parent e04d293 commit 2872df5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ export async function ncc_minimatch(task, opts) {
// eslint-disable-next-line camelcase
externals['mini-css-extract-plugin'] =
'next/dist/compiled/mini-css-extract-plugin'

export async function ncc_mini_css_extract_plugin(task, opts) {
await task
.source(
Expand All @@ -1485,6 +1486,24 @@ export async function ncc_mini_css_extract_plugin(task, opts) {
},
})
.target('compiled/mini-css-extract-plugin')
await task
.source(
relative(
__dirname,
resolve(
require.resolve('mini-css-extract-plugin'),
'../hmr/hotModuleReplacement.js'
)
)
)
.ncc({
externals: {
...externals,
'./hmr': './hmr',
'schema-utils': 'next/dist/compiled/schema-utils3',
},
})
.target('compiled/mini-css-extract-plugin/hmr')
await task
.source(
opts.src ||
Expand Down

0 comments on commit 2872df5

Please sign in to comment.