Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images not displaying in published package when using SVG or other image formats i.e jpg , png . #1180

Open
walifile opened this issue May 13, 2023 · 0 comments

Comments

@walifile
Copy link

walifile commented May 13, 2023

Description:

I am currently developing a package using TSDX, and I have encountered an issue where images, specifically SVG or other image formats, are not displaying when I import and use the components from the published package. The images are displaying correctly in Storybook.

This is my TSDX config file.

`const postcss = require('rollup-plugin-postcss');
const url = require('@rollup/plugin-url');

module.exports = {
rollup(config, options) {
config.plugins = [
// Force the url plugin to emit files.
url({ limit: 0, incude: ['/*.png', '/*.jpg'] }),
...config.plugins,
];
config.plugins.push(
postcss({
config: {
path: './postcss.config.js',
},
extensions: ['.css'],
minimize: true,
inject: {
insertAt: 'top',
},
})
);

return config;

},
};
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant