geolessel / react-phoenix

Make rendering React.js components in Phoenix easy
http://reactphoenix.com
MIT License
504 stars 38 forks source link

Very large app.js #59

Closed kristofvanwoensel closed 2 years ago

kristofvanwoensel commented 3 years ago

Is there a way to split loads with this library? My app.js is getting very large because I'm loading all components in app.js.

Suppose I load map.js in the correct html.eex file:

webpack.config.js

  entry: {
      app: ['./js/app.js'].concat(glob.sync('./vendor/**/*.js')),
      map: ['./js/Components/idiofaMapShow.js'].concat(glob.sync('./vendor/**/*.js')),
  },

map.js

class MyMap extens React.Component{...}

document.Components
{
  MyMap
}