-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Requires #4
Comments
I've never used image loading via |
https://github.com/petehunt/webpack-require looks interesting. If this works we could ditch the |
The |
It's possible to build a webpack bundle for the server and require that, but it does take a bit longer to apply the change. See webpack-contrib/webpack-hot-middleware#1 for an example |
@adri Personally I've been attempting to use https://github.com/halt-hammerzeit/webpack-isomorphic-tools has allowed me to do this quite comfortably although the module filter function for some assets can get a little messy. It supports one webpack config for both client and server compile and can be extended for more asset types. |
@tomatau Thanks! I integrated webpack-isomorphic-tools in the ultimate-hot-reloading-example and it works well for loading assets, also with css-modules. It also allows us to only use webpack for client and server rendering which is very neat. There is only one issue left before I could make a pull request. When there was an error while parsing a file (for example a CSS file) the node process seems to not respond anymore. Not sure yet why. master...adri:webpack-isomorphic-tools |
Did anyone of you experience problems that the node process gets stuck after a syntax error in the parsed code using webpack? I'm not sure how to debug it. PS: Got hot reloading working with external connections like databases. Thats another pull request. |
Found the issue. catamphetamine/webpack-isomorphic-tools#6 |
nice work @adri 👍 |
I've built a react & redux universal starter-kit/boilerplate heavily based on the examples of this repo along with universal image handling. Check it out: Thanks again for this repo, it's been great to learn from whilst building that ^ |
I'm experimenting now with running mocha tests after clearing the require caches, all in the same process. |
@adri can you share? I'm looking to add test runners to breko-hub so would be interesting to look at your setup |
Yeah https://gist.github.com/adri/7d5127d03ce5ba3e7531#file-hotreload-js-L59 |
There is a module like css-require 😄 |
I've been using this https://github.com/tomatau/node-hook-filename Works for any require type and allows you to specify how to deal with the file. |
@tomatau nice and do you have an example that would fit into this repo? |
I use it in my boilerplate when running tests https://github.com/tomatau/breko-hub/blob/master/test/node-setup.js#L20 I use webpack-isomorphic-tools for images on the server render though |
Nice work on this example, really interesting!
Experimenting locally and I can't find a solution for universal image requires using this setup.
I've worked with WebpackIsomorphicLoader to solve this problem but the
css-modules-require-hook
seems so elegant, is there an approach similar to this for getting generated image filenames from a require?The text was updated successfully, but these errors were encountered: