JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q18219F
  • License MIT

neutrino preset for react projects

Package Exports

  • neutrino-preset-pragmatic-react

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (neutrino-preset-pragmatic-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

neutrino-preset-pragmatic-react

Requirements

  • Node.js v6.9+
  • Yarn or npm client
  • Neutrino v5

Installation

Yarn

$ yarn add --dev neutrino
$ yarn add --dev neutrino-preset-pragmatic-react
$ yarn add react react-dom prop-types

npm

$ npm install --save-dev neutrino
$ npm install --save-dev neutrino-preset-pragmatic-react
$ npm install --save react react-dom prop-types

Quickstart

$ mkdir {test,src}
$ cat > src/index.js <<EOL
import React from 'react';
import { render } from 'react-dom';

render(<h1>Hello world!</h1>, document.getElementById('root'));

EOL

Now edit your project's package.json to add commands for starting and building the application:

{
 ...

 "neutrino": {
    "use": [
      "neutrino-preset-pragmatic-react"
    ]
  },
  "scripts": {
    "start": "neutrino start",
    "build": "neutrino build",
    "test": "neutrino test",
    "test-watch": "neutrino test --watch"
  },

...
}

Start the app, then open a browser to the address in the console:

Yarn

$ yarn start
✔ Development server running on: http://localhost:5000
✔ Build completed

Npm

$ npm start
✔ Development server running on: http://localhost:5000
✔ Build completed

TODO