jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.29k stars 507 forks source link

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

Open walifile opened 1 year ago

walifile commented 1 year ago

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;

}, }; `