Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Jul 27, 2023

Please Read the CONTRIBUTING Guidelines
In particular the portion on Commit Message Formatting

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe: Migrate to pure ESM module

Webpack 5.80.0 supports loaders written in ESM module. In this PR we migrate babel-loader to ESM and overhauls the test suites.

Does this PR introduce a breaking change?

  • Yes
  • No

If this PR contains a breaking change, please describe the following...

  • Impact: High
  • Migration path for existing applications: upgrade Node.js to 16.17.0 or above, and webpack to 5.80.0 (released on Apr 2023)
  • Github Issue(s) this is regarding:

Other information:
This PR depends on #1003, please review that PR first.

Given that webpack 5.80.0 was released only three months ago, I don't expect this PR will get merged soon.

Alternatively we can also ship a CJS build so that it can work with older webpack 5 versions.

JLHwung added 9 commits July 28, 2023 14:59
babel-loader 9 only supports webpack 5
In webpack 5.0.0, the mapObj.sources are

[
  'webpack://babel-loader/./test/fixtures/basic.js',
  'webpack://babel-loader/./test/fixtures/constant.js',
  'webpack://babel-loader/./test/fixtures/import.js',
  'webpack://babel-loader/webpack/bootstrap',
  'webpack://babel-loader/webpack/startup'
]

In later versions the `'webpack://babel-loader/./test/fixtures/basic.js'` is moved after webpack bootstrap, causing different indices across different webpack versions.
@JLHwung JLHwung mentioned this pull request Jun 19, 2024
11 tasks
@JLHwung
Copy link
Contributor Author

JLHwung commented Jul 24, 2024

Closing this PR as it is out of dated.

@JLHwung JLHwung closed this Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants