MadaraUchiha-314 / rollup-plugin-module-federation

A rollup plugin for module federation
https://rollup-plugin-module-federation.netlify.app/packages/examples/project-a/dist/rollup/esm/
MIT License
17 stars 1 forks source link

fix: changing file extension #65

Closed MadaraUchiha-314 closed 1 month ago

MadaraUchiha-314 commented 1 month ago

This is to fix the following error:

[!] Error: require() of ES Module /home/projects/webpack-webpack-js-org-oniddk/node_modules/rollup-plugin-module-federation/dist/cjs/index.js from /home/projects/webpack-webpack-js-org-oniddk/rollup.config.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/projects/webpack-webpack-js-org-oniddk/node_modules/rollup-plugin-module-federation/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
netlify[bot] commented 1 month ago

Deploy Preview for rollup-plugin-module-federation ready!

Name Link
Latest commit 38480985e398a8b66c9530525d074cf368801da4
Latest deploy log https://app.netlify.com/sites/rollup-plugin-module-federation/deploys/66c3ae320c6ba70008e152be
Deploy Preview https://deploy-preview-65--rollup-plugin-module-federation.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.