i was configuring a rollup.config.mjs file and
this is how i used to import json files
import packageJson from "./package.json" assert { type: "json" };
as far i have tested it works in node 20 without any errors but a warning of
(node:34471) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
but in node v22 it is not working
right now i am using node 20 for rollup thanks to nvm(node version manager).
i am expecting to know if there is way to import .json files in node v22
thank you for your time.
2
I’m not 100% sure if this is what you’re looking for but this might be helpful https://www.npmjs.com/package/@rollup/plugin-json
2