-
Notifications
You must be signed in to change notification settings - Fork 507
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
Components doesn't ship with images properly #278
Comments
got a test repo? |
Any updates on this? |
havent had time to look into this yet, sorry. if anyone wants to help investigate, or propose the solve, pls be my guest |
Sharing my config workaround to get images to work with // tsdx.config.js
const images = require('rollup-plugin-image-files')
module.exports = {
rollup(config, options) {
config.plugins = [
images({ incude: ['**/*.png', '**/*.jpg'] }),
...config.plugins,
]
return config
},
} It seems like your I tried to get this working with Maintainer edit: updated to reflect v0.13.0+ 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,
]
return config
},
} The main problem seems to be that |
Going to close the out since a solution was found. See #379 (comment) for the summary from here. Import order seems to affect this specific plugin. I'm not really sure why |
Current Behavior
I have been trying to create a react component with images for the purpose of reusing them across different apps.
However, when I build the library and import the component, the component works fine except all the images are not referenced properly
I also tried running Storybook and I got the same issue.
Expected behavior
Build process should ship images properly
Suggested solution(s)
Additional context
tsdx build
on theprepare
script in thepackage.json
babel-plugin-file-loader
,rollup-plugin-url
androllup-plugin-image
but they didn't work.Your environment
The text was updated successfully, but these errors were encountered: