Closed seveneye closed 5 years ago
I'd guess your build doesn't have the files. Since this works, per demo here
Do a complete rebuild of your app, also test if adding an image (png or jpg) and using Image
works to ensure you're files are being added to the built application.
hi @bradmartin , im using angular not sure if its a webpack issue, but it seems that gif files are not bundled. I renamed the gif to png and it worked. Thanks for your response!
That seems like a webpack issue, where you don't have the file being included in the build. This has come up before on the NS slack community and that was the case. I don't have the answer anymore though, but somewhere you have to make sure webpack knows about the files.
Indeed webpack doesn't include gifs by default. To add that to webpack I added the line
{ from: { glob: '**/*.gif', dot: false } },
to config.plugins[CopyWebpackPlugin]
. It looks like this now
new CopyWebpackPlugin([
{ from: { glob: 'assets/**', dot: false } },
{ from: { glob: 'fonts/**', dot: false } },
{ from: { glob: '**/*.jpg', dot: false } },
{ from: { glob: '**/*.png', dot: false } },
{ from: { glob: "**/*.gif", dot: false } },
], copyIgnore),
Hi @bradmartin , I cant seem to make it to work with local gifs.
My gif is located in src/app/gifs, and i reference it using
Also tried, "~/gifs/icon.gif", but they never work. It always say there is no such file or directory
Any idea on this?