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(), ],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