survivejs / react-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/react/introduction/
2.02k stars 366 forks source link

Developing with Webpack - #367

Closed jomofrodo closed 8 years ago

jomofrodo commented 8 years ago

From the chapter "Developing with Webpack" --

If you execute node_modules/.bin/webpack, you should see output like this:
_
Hash: 2dca5a3850ce5d2de54c
Version: webpack 1.12.13
Time: 85ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.75 kB       0  [emitted]  app
   [0] ./app/index.js 144 bytes {0} [built]
   [1] ./app/component.js 136 bytes {0} [built]
This means you have a build at your output directory. You can open the build/index.html file directly through a browser to examine the results. On OS X open ./build/index.html works._

I believe you mean to say "open the build/build.js file ..."?

bebraw commented 8 years ago

It's build/index.html on purpose. We set that file up earlier to point at the generated bundle. This step generates the bundle so we have something that works through build/index.html.

jomofrodo commented 8 years ago

Ah - I see. You are saying to open build/index.html in a browser, which will then load and execute build/build.js. I actually just wanted to directly inspect what had been produced (with vi). As a complete noob to webpack, it took me a couple of minutes to figure out that build/build.js is what had just been built by webpack.

bebraw commented 8 years ago

Alright. I'll clarify that. Thanks for bringing this up. :+1: