Is it actually possible to use Rollup within NX?

I have a NX monorepo Storybook component library that I need to publish. It needs to be available outside of the monorepo.

I am trying to use rollup for this but I am getting the following issue

 [!] (plugin rpt2) Error: libs/ui-shared/component-library/src/lib/components/header-sg/header-sg.tsx:3:21 - error TS2307: Cannot find module '../../assets/icons/icons.stack.svg' or its corresponding type declarations.
import SgIcons from '../../assets/icons/icons.stack.svg';

I'm pointing the rollup config to the storybook TS config

 plugins: [ peerDepsExternal(), resolve(), image(), typescript({ tsconfig: './libs/ui-shared/component-library/tsconfig.json', }), postcss(), terser(), uglify(), ],

enter image description here

But it doesn't seem to be using it?

Is it actually possible to use Rollup within NX? Or am I going to have to pull Storybook out of the monorepo?

Thanks

Related questions 24 How to best include assets (images and fonts) referenced in scss files in rollup bundle 10 Plugin typescript: @rollup/plugin-typescript TS2307: Cannot find module './App.svelte' or its corresponding type declarations 7 React Rollup: 'name' is not exported by node_modules/ Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like