Skip to content

Remove unmaintained file-loader dependency#1398

Merged
Kocal merged 1 commit intosymfony:mainfrom
Kocal:webpack-encore-1396
Mar 11, 2026
Merged

Remove unmaintained file-loader dependency#1398
Kocal merged 1 commit intosymfony:mainfrom
Kocal:webpack-encore-1396

Conversation

@Kocal
Copy link
Copy Markdown
Member

@Kocal Kocal commented Mar 11, 2026

Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #1396
License MIT

This PR removes the deprecated file-loader dependency in favor of webpack's Asset Modules.
This loader was previously used in Encore.copyFiles().

@Kocal Kocal self-assigned this Mar 11, 2026
@carsonbot carsonbot added Feature New Feature Status: Needs Review Needs to be reviewed labels Mar 11, 2026
@Kocal Kocal force-pushed the webpack-encore-1396 branch from 0aeab24 to 17020ea Compare March 11, 2026 13:13
@Kocal Kocal requested a review from Copilot March 11, 2026 13:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated file-loader dependency and updates Encore.copyFiles() to emit copied assets via a custom webpack loader using webpack’s native emission APIs.

Changes:

  • Drop file-loader from dependencies and related feature/package checks.
  • Rework copy-files-loader to compute hashes and emit files via this.emitFile(), including a new template interpolator for supported placeholders.
  • Update docs/tests/changelog for the migration, including documenting the BC break for [N] placeholders.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Removes file-loader from dev + peer dependencies and metadata.
yarn.lock Removes file-loader lock entries and adjusts related transitive deps.
lib/features.js Removes the copy_files feature package requirement for file-loader.
lib/config-generator.js Stops enforcing file-loader; passes filename to the custom copy loader.
lib/webpack/copy-files-loader.js Replaces file-loader usage with emitFile() and placeholder interpolation.
test/functional.js Removes functional coverage for legacy [N] capture-group placeholder behavior.
index.js Updates copyFiles() placeholder documentation.
CHANGELOG.md Notes file-loader removal and documents BC break for [N] placeholders.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Kocal Kocal changed the title Migrate from (deprecated) file-loader, use webpack's Asset Modules instead Remove unmaintained file-loader dependency Mar 11, 2026
@Kocal Kocal force-pushed the webpack-encore-1396 branch from c819f8f to 1200947 Compare March 11, 2026 22:55
@Kocal Kocal merged commit b8c997b into symfony:main Mar 11, 2026
@Kocal Kocal deleted the webpack-encore-1396 branch March 11, 2026 22:55
@Kocal Kocal added this to the 6.0 milestone Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Needs Review Needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate from (deprecated) file-loader

3 participants