Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
  • Loading branch information
shuding and sokra committed Oct 16, 2022
1 parent 8e175bc commit b0dfa25
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/next/build/webpack/plugins/flight-types-plugin.ts
Expand Up @@ -83,11 +83,10 @@ export class FlightTypesPlugin {
if (!mod.resource.startsWith(this.appDir + path.sep)) return
if (!/\.(js|jsx|ts|tsx|mjs)$/.test(mod.resource)) return

const IS_LAYOUT = /[/\\]layout\.[^.]+$/.test(mod.resource)
const IS_LAYOUT = /[/\\]layout\.[^./\\]+$/.test(mod.resource)
const IS_PAGE = !IS_LAYOUT && /[/\\]page\.[^.]+$/.test(mod.resource)
const relativePath = path.relative(this.appDir, mod.resource)

// const RSC = mod.buildInfo.rsc

const typePath = path.join(
'types',
Expand Down Expand Up @@ -116,7 +115,7 @@ export class FlightTypesPlugin {
}
}

compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.processAssets.tap(
{
name: PLUGIN_NAME,
Expand Down

0 comments on commit b0dfa25

Please sign in to comment.