feat(json): Add `extensions` option to load JSON files with custom extensions.
Rollup Plugin Name: json
This PR contains:
- [ ] bugfix
- [x] feature
- [ ] refactor
- [ ] documentation
- [ ] other
Are tests included?
- [x] yes (bugfixes and features will not be merged without tests)
- [ ] no
Breaking Changes?
- [ ] yes (breaking changes will not be merged unless absolutely necessary)
- [x] 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 adds support for custom file extensions in the JSON plugin, allowing handling beyond the default .json files. Previously, the plugin only handled .json files, limiting use with custom formats (such as .resjson)
Changes
packages/json/README.md: Added documentation for the newextensionsoption that allows specifying a list of file extensions to be handled by the plugin.packages/json/src/index.js: Introduced theextensionsoption in the JSON plugin's configuration, allowing users to specify which file extensions should be processed.packages/json/test/fixtures/custom-file-extension/config.customjson: Added a test fixture with a custom file extension to verify the new feature.packages/json/test/fixtures/custom-file-extension/main.js: Added a test case to import and validate the custom file extension handling.packages/json/test/test.js: Added new test cases to ensure the plugin correctly processes files with custom extensions and ignores non-custom extensions.
Small nits on the docs for this feature. Once those are tackled we can merge. Thank you for the PR.
@shellscape I’ve gone ahead and addressed your comments. Let me know if there’s anything else I missed.
Hey @shellscape, I've addressed your comments. Can you review this PR again when you have time?
@altinokdarici looks like there's a prettier issue. please run lint and tag me again when you update