javascript - web pack require() or not? react-hot-loader ES6 or jsx? -


i looking @ react-hot-loader boilerplate.
thought using web pack serving javascript in 1 or smaller build.js(name defined), , required use "require('name'). looks boilerplate using es6 "import react 'react';"?


, using react-hot-loader or react-loader sugar ontop of javascript, boilerplate using export default class app extends, es6?

basically same thing. since using babel, allows them use es6 syntax. webpack handles loaders; can see babel loader in webpack config.

this es6 module syntax:

es6 import

import react 'react'; 

es6 export

export default something; 

commonjs import

require('react'); 

commonjs export

module.exports = something; 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -