Skip to content

Localization Plugin webpack 5 #3459

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

Merged
merged 3 commits into from
Jun 23, 2022

Conversation

dmichon-msft
Copy link
Contributor

Summary

Adds a webpack 5 compatible version of @rushstack/localization-plugin, intended to be published as major version 5 of the same name.
Depends on #3455 for necessary changes to @rushstack/localization-utilities.

Details

The interface for the webpack 5 plugin is a bit more generic and less opinionated than the webpack 4 version, and requires developers to install the loaders manually (as they would for, e.g. mini-css-extract-plugin). The loaders support json or javascript/esm output for flexibility.

The plugin adds support for the [locale] token in the output.chunkFilename and output.filename webpack configuration properties.

How it was tested

Unit test coverage of:

  • No localized strings files -> all chunks have locale none
  • No async chunks, but with localized strings -> localized entry chunks
  • Localized files in async chunks, no dynamic locale expression -> localized async chunks + localized runtimes
  • Localized files in async chunks, dynamic locale expression -> localized async chunk + generic runtime
  • Changing translations changes chunk hash
  • Localized stats files

@octogonz
Copy link
Collaborator

Please investigate #3460 first. It seems we need to deprecate the published @rushstack/webpack5-module-minifier-plugin, right?

@dmichon-msft dmichon-msft force-pushed the localization-plugin-5 branch 2 times, most recently from 9019417 to 46f0872 Compare June 14, 2022 00:36
@dmichon-msft dmichon-msft force-pushed the localization-plugin-5 branch 3 times, most recently from 236de14 to fe42caf Compare June 22, 2022 20:49
@dmichon-msft dmichon-msft force-pushed the localization-plugin-5 branch from 70e5f31 to b19993d Compare June 22, 2022 22:57
@dmichon-msft dmichon-msft merged commit 24dc125 into microsoft:main Jun 23, 2022
@dmichon-msft dmichon-msft deleted the localization-plugin-5 branch June 23, 2022 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants