olahol / reactpack
- суббота, 4 июня 2016 г. в 03:13:03
JavaScript
📦 build your react apps with one command and one `npm i`.
one command to build your React frontend.
npm i
needed..eslintrc
or with standard
.react
, es2015
and stage-0
.precss
and autoprefixer
.html-webpack-plugin
.--watch
).--dev
).uglify
and cssnano
(-O
).$ npm i reactpack -g
or
$ npm i reactpack --save-dev
import React, { Component } from 'react'
import { render } from 'react-dom'
require('bootstrap/dist/css/bootstrap.css')
class Example extends Component {
render () {
return <h1>Hello World!</h1>
}
}
render(<Example />, document.getElementById('react-app'))
{
...
"scripts": {
"build": "reactpack src/index.js",
},
"dependencies": {
"bootstrap": "^3.3.6",
"react": "^15.1.0",
"react-dom": "^15.1.0",
},
"devDependencies": {
"reactpack": "^0.2.0"
},
...
}
Usage: reactpack [options] <entry> [path/to/bundle]
Options:
-h, --help output usage information
-V, --version output the version number
-q, --quiet no output
-O, --optimize optimize css and js using minifiers
-w, --watch watch mode, rebuild bundle on file changes
-d, --dev start a dev server with hot module replacement
-p, --port port for dev server (default is 8000)
--standard force standard linting (do not look for eslint config)
--clean delete everything in bundle path before building
--no-source-map don't output source maps for css and js
--no-postcss dont't use postcss (autoprefixer and precss)
--no-html don't output an index.html
--no-lint turn off linting