Skip to content

Commit

Permalink
Merge branch 'canary' into inline/amp-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Feb 11, 2021
2 parents a787ead + 6b99bda commit af13738
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"lint-staged": "lint-staged",
"next": "node --trace-deprecation packages/next/dist/bin/next",
"trace": "node --trace-deprecation -r ./bench/instrument.js packages/next/dist/bin/next",
"trace-debug": "node --inspect --trace-deprecation -r ./bench/instrument.js packages/next/dist/bin/next",
"debug": "node --inspect packages/next/dist/bin/next"
},
"pre-commit": "lint-staged",
Expand Down
28 changes: 15 additions & 13 deletions packages/next/build/webpack/plugins/profiling-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,24 @@ export class ProfilingPlugin {
compiler.hooks.environment,
compiler.hooks.afterEnvironment
)
this.traceHookPair(
'webpack-invalidated',
compiler.hooks.invalid,
compiler.hooks.done
)
if (compiler.options.mode === 'development') {
this.traceHookPair(
'webpack-invalidated',
compiler.hooks.invalid,
compiler.hooks.done
)
}
}

traceCompilationHooks(compiler: any) {
if (isWebpack5) {
this.traceHookPair(
'webpack-compilation',
compiler.hooks.beforeCompile,
compiler.hooks.afterCompile
)
}

compiler.hooks.compilation.tap(pluginName, (compilation: any) => {
compilation.hooks.buildModule.tap(pluginName, (module: any) => {
const compilerSpan = spans.get(compiler)
Expand All @@ -118,14 +128,6 @@ export class ProfilingPlugin {
spans.get(module).end()
})

if (isWebpack5) {
this.traceHookPair(
'webpack-compilation',
compilation.hooks.beforeCompile,
compilation.hooks.afterCompile
)
}

this.traceHookPair(
'webpack-compilation-chunk-graph',
compilation.hooks.beforeChunks,
Expand Down

0 comments on commit af13738

Please sign in to comment.