Create React apps with zero initial configuration. react-starter
is built using Neutrino to harness the power of Webpack with the simplicity of presets.
- Zero upfront configuration necessary to start developing and building a React web app
- Extends from neutrino-preset-react
- Modern Babel compilation adding JSX and object rest spread syntax
- Support for React Hot Loader
- Write JSX in .js or .jsx files
- Extends from neutrino-preset-web
- Modern Babel compilation supporting ES modules, last 2 major browser versions, and async functions
- Webpack loaders for importing HTML, CSS, images, icons, and fonts
- Webpack Dev Server during development
- Automatic creation of HTML pages, no templating necessary
- Hot Module Replacement support
- Production-optimized bundles with Babili minification and easy chunking
- Easily extensible to customize your project as needed
- Node.js v6.9+
- Yarn or npm client
To get you started fork and clone the react-starter
repository and install the dependencies using Yarn or the npm client.
❯ cd react-starter/
❯ yarn
❯ yarn start
✔ Development server running on: http://localhost:5000
✔ Build completed
❯ npm start
✔ Development server running on: http://localhost:5000
✔ Build completed
react-starter
builds static assets to the build
directory by default when running yarn build
.
❯ yarn build
✔ Building project completed
Hash: a3a9a0f61ddbfe6d0df1
Version: webpack 2.6.1
Time: 10664ms
Asset Size Chunks Chunk Names
index.f4accb410f193a07d59b.js 6.72 kB index [emitted] index
polyfill.2f048c34ff815def7987.js 49.2 kB polyfill [emitted] polyfill
runtime.657c5e7df3c8dd071e60.js 1.55 kB runtime [emitted] runtime
vendor.6346e2d5798e9a77c2f0.js 180 kB vendor [emitted] vendor
index.html 926 bytes [emitted]
✨ Done in 12.35s.
In order to keep this starter kit minimalist, react-starter
has no test runner configured, however adding one is incredible easy with Neutrino. Refer to the relevant section on building and running tests.
You can provide custom options and have them merged with this preset's default options to easily affect how this preset builds. You can modify React preset settings from .neutrinorc.js
by overriding with an options object. Use an array pair instead of a string to supply these options in .neutrinorc.js
. See the Web documentation for specific options you can override with this object.
Example: Change the application mount ID from "root" to "app" and change the page title:
module.exports = {
use: [
['neutrino-preset-react', {
html: {
title: 'Epic React App',
appMountId: 'app'
}
}]
]
};
By following the customization guide and knowing the rule, loader, and plugin IDs above, you can override and augment the build by by providing a function to your .neutrinorc.js
use array. You can also make these changes from the Neutrino API in custom middleware.
By defining an entry point named vendor
you can split out external dependencies into a chunk separate from your application code.
Example: Put React and React DOM into a separate "vendor" chunk:
module.exports = {
use: [
'neutrino-preset-react',
(neutrino) => neutrino.config
.entry('vendor')
.add('react')
.add('react-dom')
]
};
Thank you for wanting to help out with Neutrino! We are very happy that you want to contribute, and have put together the contributing guide to help you get started. We want to do our best to help you make successful contributions and be part of our community.