bradmartin / nativescript-gif

NativeScript plugin to use native gifs
Other
50 stars 18 forks source link

Animated gif not loading with src parameter as res:// #32

Closed sivaprasad-kiranum closed 5 years ago

sivaprasad-kiranum commented 5 years ago

The animated gif is not loading then the src parameter is given as res://

TySabs commented 5 years ago

It looks like there is a bug with webpack not bundling .gif files. Try renaming your gif file as .png and navigate from the root using '~'

bradmartin commented 5 years ago

I don't think that's a "bug", that to me indicates the webpack config isn't configured correctly. Granted, this should be documented on the README for the plugin 😄 You'll need to find this part of your webpack.config.js file and add the .gif glob.

      // Copy assets to out dir. Add your own globs as needed.
      new CopyWebpackPlugin(
        [
          { from: { glob: 'assets/**' } },
          { from: { glob: 'fonts/**' } },
          { from: { glob: '**/*.gif' } },
          { from: { glob: '**/*.jpg' } },
          { from: { glob: '**/*.png' } }
        ],