@constgen/neutrino-react-launcher

1.9.3 • Public • Published

@constgen/neutrino-react-launcher

npm npm

Neutrino middleware for an automatic React application launching in a browser document with hot reload

Using this middleware you no longer need to bootstrap HMR and app mounting. It is done automatically. The only thing you need is to only export the main JSX component in your main application component (entry file)

src/index.jsx

import React from 'react'

export default class extends React.Component {
   render () {
      return <h1>Root component</h1>
   }
}

Features

  • Enabled Hot Module Replacement with source-watching during development
  • Disabled redundant [HMR] console messages
  • Debug console cleared on every file change. Your outdated logs will be removed

Requirements

  • Node.js v10+
  • Neutrino v9
  • Webpack v4
  • React v16, v17

Installation

@constgen/neutrino-react-launcher can be installed from NPM. You should install it to "dependencies" (--save) or "devDependncies" (--save-dev) depending on your goal.

npm install --save @constgen/neutrino-react-launcher

Usage

In preset

Require this package and plug it into Neutrino. The middleware has no options:

let reactLauncher = require('@constgen/neutrino-react-launcher')

neutrino.use(reactLauncher())

In neutrinorc

The middleware also may be used together with another presets in Neutrino rc-file, e.g.:

.neutrinorc.js

let reactLauncher = require('@constgen/neutrino-react-launcher')

module.exports = {
   use: [
      reactLauncher()
   ]
}

Package Sidebar

Install

npm i @constgen/neutrino-react-launcher

Weekly Downloads

1

Version

1.9.3

License

GPL-3.0

Unpacked Size

39.8 kB

Total Files

6

Last publish

Collaborators

  • constgen