contentful.js
contentful.js copied to clipboard
Transpile into ECMAScript Module
Expected Behavior
Transpile contentful.js into ECMAScript module.
Actual Behavior
contentful.js is transpiled into CommonJS module.
Context
I'm using your library in an Angular project and it outputs warning when I try to build it:
Warning: contentful.ts depends on 'contentful'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
You can find more information here:
Configuring CommonJS dependencies
It is recommended that you avoid depending on CommonJS modules in your Angular applications. Depending on CommonJS modules can prevent bundlers and minifiers from optimizing your application, which results in larger bundle sizes. Instead, it is recommended that you use ECMAScript modules in your entire application.
How CommonJS is making your bundles larger
Environment
- Package Version: 8.4.2
Same thing to get this working with svelte kit https://github.com/sveltejs/kit/issues/928
This ticket has been closed due to inactivity. If you still need help resolving your issue, please reach out through our community Slack, or contact Contentful support directly.