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

fix(alias): prepare for Rollup 3, handle latest node-resolve #1269

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

lukastaegert
Copy link
Member

@lukastaegert lukastaegert commented Sep 23, 2022

BREAKING CHANGES: Requires Node 14

Rollup Plugin Name: alias

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

This PR updates the plugin for Rollup 3 compatibility. This will not change compatibility with older Rollup versions.
It contains the following:

  • Update minimal required Node version to 14 (also reflected in README, breaking change)
  • Extend Rollup peerDependency version with ||^3.0.0
  • Make Rollup an optional peerDependency as technically, plugins do not require Rollup but only depend on its API. Apparently solves issues with pnpm, see fix(inject): rollup is optional peer dependency #1272
  • Use a shared Rollup config for all plugins
    • This allows to share bundling improvements and unifies the build

    • All plugins now use strictDeprecations to fail early if they use deprecated Rollup features as well as an onward handler that fails the build

    • The CJS output now uses

      exports: 'named',
      footer: 'module.exports = Object.assign(exports.default, exports);'
      

      which will allow the default export to be directly required while still supporting named exports

  • The "exports" package.json field is now properly configured for require and import.
  • CJS and ESM output are now in different sub-folders with a package.json file with "type": "module" next to the CJS output (via the shared Rollup config)
  • Internally, the latest Rollup 3 pre-release build is used to ensure compatibility
  • Rollup configs now follow Node semantics, i.e. .mjs for ESM configs, no direct import of package.json
  • TypeScript output has been changed to target ES2019

For the alias plugin, this also fixes an issue where it no longer worked correctly with latest node-resolve due to the new object hook form.

@lukastaegert lukastaegert marked this pull request as draft September 26, 2022 07:02
@lukastaegert
Copy link
Member Author

Converting to draft as I want to add some more changes to those PRs

@lukastaegert lukastaegert force-pushed the alias/rollup-3 branch 3 times, most recently from 2c88637 to 520fbcd Compare September 30, 2022 03:52
@lukastaegert lukastaegert changed the base branch from master to repo/rollup3-updates September 30, 2022 03:55
@lukastaegert lukastaegert marked this pull request as ready for review September 30, 2022 07:12
Base automatically changed from repo/rollup3-updates to master October 7, 2022 18:41
@lukastaegert lukastaegert merged commit ae4e9b3 into master Oct 7, 2022
@lukastaegert lukastaegert deleted the alias/rollup-3 branch October 7, 2022 19:47
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