catamphetamine / webpack-isomorphic-tools

Server-side rendering for your Webpack-built applications (e.g. React)
MIT License
1.25k stars 48 forks source link

Unexpected token less file #167

Closed arman-mukatov closed 3 years ago

arman-mukatov commented 3 years ago

I want to start a new big project where I am not using isomorphic/universal-webpack or next.js, how can I get the required call on the server-side to work?

catamphetamine commented 3 years ago

how can I get the require call on the server side to work?

Only *.js / *.json requires work on server side. Anything more than that requires using a bundler like Webpack, or a framework that uses a bundler internally.

arman-mukatov commented 3 years ago

I use webpack v5, but how to return the real path to the image or css on the disk on SSR?

catamphetamine commented 3 years ago

By using a file-loader. They seem to have renamed it to something else in v5, like "webpack assets".

arman-mukatov commented 3 years ago

This is for the client-side, but what about the server-side?

catamphetamine commented 3 years ago

This is for the server side

catamphetamine commented 3 years ago

They had target: "node" parameter or something like that.