DEV Community

Discussion on: How to easily create JS libraries with bundled dependencies compatible with ES/AMD/UMD/CJS module systems using Nx

 
samhecquet profile image
Samuel Hecquet • Edited

you're right!
For people being in the same situation that I was and ending up in this article, I fixed it by pointing to a customized rollup config file and using "@rollup/plugin-url" for the fonts:

const url = require('@rollup/plugin-url');
const nrwlConfig = require('@nrwl/react/plugins/bundle-rollup');

module.exports = (config) => {
  const originalConfig = nrwlConfig(config);
  return {
    ...originalConfig,
    plugins: [
      ...originalConfig.plugins,
      url({
        limit: 100000,
        include: ['**/*.woff', '**/*.woff2'],
      }),
    ],
  };
};
Enter fullscreen mode Exit fullscreen mode

I think it also works with jpg

Thread Thread
 
ipreda profile image
Iulian Preda

Thank you for your contribution!