Comments (15)
It took a while but the server-side now uses Webpack too. That means many webpack loaders should work on the server as well including url-loader
and css-loader
. (Piping is also gone, the server gets instant code updates from Webpack HMR!)
So please try release ^5.0.0.
from react-isomorphic-starterkit.
Did you change that config in both webpack files?
from react-isomorphic-starterkit.
yes
from react-isomorphic-starterkit.
Looks like babel/register
expects correct js file in require
from react-isomorphic-starterkit.
Ah... it makes sense. As it currently works, babel/register
does not read from the config files. You'll need to configure it in babel.server.js
, or use the require("url?...")
syntax.
Right now I'm investigating the option to go back to webpack-built server builds with hot-reloading, instead of using babel/register
. Should make this problem go away.
from react-isomorphic-starterkit.
I see. That was the reason I wanted to check out this repo in the first place though. So I could avoid building a huge React bundle and running that from Node (babel drops optimisation when files get too big, for instance)
from react-isomorphic-starterkit.
@sslash I'm using a technique by James Long @jlongster to exclude node_modules from the server build, and let node require them at runtime.
from react-isomorphic-starterkit.
Yes. Still these bundles tend to be quite large. However, using your current setup in this repo, I am still not able to require in png files. I am using require("url?./logo.png") as you propose, but it doesnt seem to locate the file. I am certain it is in the same directory and that I have included the url-loader properly. Are you able to make it work @RickWong?
from react-isomorphic-starterkit.
Haven't had a lot of time lately to release this. But the basic builds I've got aren't large at all. I'm talking about roughly 20 KB taking 1100 ms to build from a cold cache. Still having some issues with hot-reloading though...
from react-isomorphic-starterkit.
I try to remove babel/register in my project.
ES6 vs fast-reload
I go for fast-reload
from react-isomorphic-starterkit.
any update on this?
from react-isomorphic-starterkit.
the webpack isomorphic tools package may help with loading images, although it will require a bit of setup. It was made to solve the problem of require() 'ing images and css on the server: https://github.com/halt-hammerzeit/webpack-isomorphic-tools
from react-isomorphic-starterkit.
@sslash: I'm having the same issue with babel-core/register
on the server side. Did you ever find a solution?
from react-isomorphic-starterkit.
nah haven't looked into this issue sry
from react-isomorphic-starterkit.
When I ran into this, I was running tests from the CLI. The solution that I found was to use require.extensions via a custom compiler. Not sure if this is of any help @calvinl or others, but I thought I would share. Here is an issue that outlines the fix in more detail: bruderstein/unexpected-react#1
from react-isomorphic-starterkit.
Related Issues (20)
- hot reloading client side not working
- Timed out waiting for dist/*.js after 30 seconds HOT 2
- Internal Server Error when running npm run watch HOT 3
- React-router example
- Location object does not get passed to components server side.
- Had to downgrade to Node v5 for `npm run watch` to work HOT 4
- Images not loading in Webpack build
- Heroku deployment is not working simple express app
- 帅哥,服务端渲染的原理是什么?
- General questions about react-transmit usage within this kit HOT 2
- `Server-side React render was discarded` after migrating to express HOT 1
- Passing custom data (e.g. token) to props during server-side render HOT 1
- Nested containers (with getFragment) prevents server from rendering HOT 3
- npm run watch fails after update to webpack 2 HOT 1
- Doesn't work HOT 1
- Help? It fails to start
- All done but nothing works HOT 3
- Operand to 'typeid'
- not working HOT 2
- does not work out of the box
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-isomorphic-starterkit.