React-native-web: BUG in Getting Started webpack.config.js

Created on 9 Oct 2017  路  3Comments  路  Source: necolas/react-native-web

Need to add this at the top of the webpack.config.js:

var path = require('path');
var webpack = require('webpack');

Most helpful comment

Maybe simply stating that it's not a complete example would make it clear? Personally, I've run into many 'almost complete' examples on sites and it's a little frustrating when it doesn't work.

All 3 comments

It's not intended to be a compete and working js file

Maybe simply stating that it's not a complete example would make it clear? Personally, I've run into many 'almost complete' examples on sites and it's a little frustrating when it doesn't work.

When the instructions say "Create a web/webpack.config.js file:" It should be a complete example from scratch.

There should be a pathway from:

  • "react-native init Project"
  • Update Babel
  • Add webpack.js
  • Build and run

At this point, the Getting Started should have a warning (Note: not really because there are some gaps and you'll just have to figure that out - good luck searching google for a webpack.config that will work for you).

If I figure it out, I'll add it here

Was this page helpful?
0 / 5 - 0 ratings