0

i have React SSR app. I have folder's structure like this:

enter image description here

I have static express middleware which handles my static and images in tag on client it works correctly:

enter image description here

But when i try to get ssr (renderToPipeableStream) my app i have path to my image like this:

http://localhost:3000/d167bb73efa5dba9019c.png

How can i configure it to start processing photos in the static folder?

Express middleware:

const server = express();

server.use('/static', express.static(path.join(__dirname, '/static')));

user469485
  • 55
  • 6

1 Answers1

0

you can look at this

  1. link 1
  2. link 2

I think you need to add this code to your Webpack config:

module: {
    loaders: [
      { test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' }
    ]
  }
yakov
  • 331
  • 5
  • 12