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
Post a Comment