Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused dependencyFactory plugin code #74661

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@ export class AppBuildManifestPlugin {
}

public apply(compiler: any) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation: any, { normalModuleFactory }: any) => {
compilation.dependencyFactories.set(
webpack.dependencies.ModuleDependency,
normalModuleFactory
)
compilation.dependencyTemplates.set(
webpack.dependencies.ModuleDependency,
new webpack.dependencies.NullDependency.Template()
)
}
)

compiler.hooks.make.tap(PLUGIN_NAME, (compilation: any) => {
compilation.hooks.processAssets.tap(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,6 @@ export class FlightClientEntryPlugin {
}

apply(compiler: webpack.Compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
webpack.dependencies.ModuleDependency,
normalModuleFactory
)
compilation.dependencyTemplates.set(
webpack.dependencies.ModuleDependency,
new webpack.dependencies.NullDependency.Template()
)
}
)

compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) =>
this.createClientEntries(compiler, compilation)
)
Expand Down
33 changes: 11 additions & 22 deletions packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,17 @@ export class ClientReferenceManifestPlugin {
}

apply(compiler: webpack.Compiler) {
compiler.hooks.compilation.tap(
PLUGIN_NAME,
(compilation, { normalModuleFactory }) => {
compilation.dependencyFactories.set(
webpack.dependencies.ModuleDependency,
normalModuleFactory
)
compilation.dependencyTemplates.set(
webpack.dependencies.ModuleDependency,
new webpack.dependencies.NullDependency.Template()
)
compilation.hooks.processAssets.tap(
{
name: PLUGIN_NAME,
// Have to be in the optimize stage to run after updating the CSS
// asset hash via extract mini css plugin.
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,
},
(assets) => this.createAsset(assets, compilation, compiler.context)
)
}
)
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
compilation.hooks.processAssets.tap(
{
name: PLUGIN_NAME,
// Have to be in the optimize stage to run after updating the CSS
// asset hash via extract mini css plugin.
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,
},
(assets) => this.createAsset(assets, compilation, compiler.context)
)
})
}

createAsset(
Expand Down
Loading