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(strip): prepare for Rollup 3 #1284

Merged
merged 1 commit into from
Oct 10, 2022
Merged

fix(strip): prepare for Rollup 3 #1284

merged 1 commit into from
Oct 10, 2022

Conversation

lukastaegert
Copy link
Member

BREAKING CHANGES: Requires Node 14

Rollup Plugin Name: strip

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) Requires Node 14
  • 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

@lukastaegert lukastaegert marked this pull request as ready for review October 1, 2022 04:33
Base automatically changed from repo/rollup3-updates to master October 7, 2022 18:41
BREAKING CHANGES: Requires Node 14
@lukastaegert lukastaegert merged commit b2d0988 into master Oct 10, 2022
@lukastaegert lukastaegert deleted the strip/rollup-3 branch October 10, 2022 14:15
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.

1 participant