-
Notifications
You must be signed in to change notification settings - Fork 333
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
React Component and static resources (images) #195
Comments
Webpack isn't used when building a component to I would suggest using a top-level directory for static resources, adding it to package.json The best way to do this is still an open question, this is just what's worked for me when publishing components which needed to import static resources, which I've done very little of. |
IMO delivered components must be in complete form and users must not do any extra work to use them, nor they have to have "appropriate" environment to use them. I was thinking to copy statics to extra: {
devtool: 'source-map',
plugins: [
new CopyWebpackPlugin([
{ from: 'src/images', to: 'es/images' },
{ from: 'src/images', to: 'lib/images' }
])
]
} can you help me set up this plugin and use it in Thanks. |
After copying static images to events.js:154
throw er; // Unhandled 'error' event
^
SyntaxError: Unexpected character '�' It seems like webpack and browserify really can't be used in conjunction. |
Why was this closed? It still seems to be an issue. @insin |
The images are not currently included in the build, or, possibly, are merely not found by thicket-webapp when it uses NavLinks. I'm not currently certain the best way to get around this issue. Trying to follow along with some suggestions here, but so far not working: insin/nwb#195
Is there a way to let the build process copy the assets to the the |
Nevemind, I've just found out about the |
Hi,
Using
nwb
I'm creating react components and consume them in other projects, so far it's been smooth. However static resources causing the other projects to break.I have configured
nwb config
to load images fromsrc/images
, and this works fine since webpack is used.When I build and try to consume the component in other project which is using
gulp
, I receiveError: Cannot find module 'img/ic_add_question_mark.png'
.How do I handle this as I'm not very good at webpack? I also notice that
src/images
is not being copied to neitherlib
nores
...Thanks.
The text was updated successfully, but these errors were encountered: