#Webpack build missing assets

8 messages · Page 1 of 1 (latest)

analog bobcat
#

HI guys, I have a project I've been working on using react . The webpack build is missing all my images even after configuring my webpack.config .js file (attached) with asset module. Anyone with a clue on how to solve this?

rocky oxide
#

@analog bobcat you're are indeed configuring webpack for your styles and js code but I think this could be because of no transformer being used for images.


        test: /\.(jpg|png|gif)$/,
        use: [
          {
            loader: 'url-loader',
            options: {
              // Inline files smaller than 10 kB
              limit: 10 * 1024
            }
          },
          {
            loader: 'image-webpack-loader',
            options: {
              mozjpeg: {
                enabled: false
                // NOTE: mozjpeg is disabled as it causes errors in some Linux environments
                // Try enabling it in your environment by switching the config to:
                // enabled: true,
                // progressive: true,
              },
              gifsicle: {
                interlaced: false
              },
              optipng: {
                optimizationLevel: 7
              },
              pngquant: {
                quality: '65-90',
                speed: 4
              }
            }
          }
        ]
      }

Try something like this maybe idk might work (there are deps please don't forget to install them first)

#

please paste the code from next time don't use images

analog bobcat
rocky oxide
#

indeed that is what the config above will try to do if you have any images imported

#

so you want every of yours assets to move directly something like that?

#

um the only way would be to experiment around

analog bobcat