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

Move polyfill resolution from webpack to package.json #7395

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fgnass
Copy link
Contributor

@fgnass fgnass commented Feb 6, 2025

Summary

This PR simplifies the setup for users consuming decap-cms-app directly by addressing Node.js built-in dependencies in a different way.

Problem:

  1. Many decap packages depend on Node.js built-ins (particularly path)
  2. Currently, these are only polyfilled via webpack configuration in the pre-built bundle
  3. Users consuming decap-cms-app directly must manually configure their build tools to provide these polyfills

Solution:

  1. Leverage the standard browser field in package.json to specify browser-compatible alternatives
    • This is widely supported by modern build tools (webpack, Vite, Rollup, etc.)
    • Eliminates need for manual polyfill configuration
  2. Reduce polyfill requirements by:
    • Using @iarna/toml/parse-string instead of full @iarna/toml to eliminate stream dependency
    • Updating minimatch to a more recent version which removes Node.js built-in dependencies

These changes make the library more portable and easier to integrate across different build environments.

Test plan

  • Build succeeds ✅
  • tests:all pass ✅
  • demo runs ✅

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)

🐣

@fgnass fgnass requested a review from a team as a code owner February 6, 2025 13:22
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