Skip to content

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

@walifile

Description

@walifile

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;

},
};
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions