anorudes / redux-easy-boilerplate

React redux easy boilerplate
MIT License
633 stars 123 forks source link

No index.html inside of /dist #70

Closed hackingbeauty closed 8 years ago

hackingbeauty commented 8 years ago

When I run the production build command

npm run build:production

The /dist folder is successfully created; however, there is no index.html inside of /dist. Am I missing a step?

vnglst commented 8 years ago

It's in the root / project directory. Had to look for it as well.

hackingbeauty commented 8 years ago

Right, but the main index.html file doesn't get moved to the /dist directory when running:

npm run build:production

Is there any way to get index.html into the /dist directory so it can easily be deployed?

anorudes commented 8 years ago

Hello, today i pushed 3 version of boilerplate and we don't have index.html now

makstr commented 8 years ago

any plan to bring back the static build option?

anorudes commented 8 years ago

@makstr Hello, you can change main template in /app/server/utils/render.js

makstr commented 8 years ago

@anorudes thank you for the tip, based on the render.js I created /index.html but it does not render anything, nor does it produce any errors. Can you point to any other changes we should look to apply in order to accomodate a static js file distribution?

<!doctype html>
<meta charset="utf-8">
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1.0, minimum-scale=1.0, maximum-scale=1.0">

    <meta property="og:type" content="website" />
    <meta property="og:url" content= />

  </head>
  <body>
    <div id="root"></div>

    <script>
      window.__INITIAL_STATE__ = {};
    </script>

    <script src="dist/vendor.js"></script>
    <script src="dist/main.js"></script>
  </body>
</html>
anorudes commented 8 years ago

@makstr You can run the app with index.html but server-side-rendering will not work. for dev: $ npm run start $ npm run api

for prod: $ npm run build $ npm run start:prod $ npm run api:prod

Also need fix "app/server/server.js" file. Replace Express.static with this:

app.use('/', Express.static(__dirname + '/../../'));

And remove this: http://joxi.ru/YmEKx00FZk4L1A

makstr commented 8 years ago

@anorudes thanks again, the objective is to get a static build which could be deployed without node.js, I forked and I am trying to get it to work here https://github.com/makstr/redux-easy-boilerplate/commit/fde11183102f04ad7c5bd78b394a4833bc2a4773