regether-rc-server
react component develop server
Last updated 5 years ago by yanweiqing .
MIT · Original npm · Tarball · package.json
$ cnpm install regether-rc-server 
SYNC missed versions from official npm registry.

ReadME

Develop tool for developing React Component

Remember to follow File Structure Guide of cat-component below

File Structure Guide

-assets/ // less files
-examples/
-src/ //put your component here
-readme.md
-package.json

Start Server

npm install cat-server

node node_modules/.bin/cat-server // default port 7777

Publish

node node_modules/.bin/pre-publish // Compile files

npm publish

examples/simple.jsx

import React from 'react';
import ReactDOM from 'react-dom';

class Example extends React.Component {
	alert() {
    	alert('This is a simple example');
  	}
	render() {
    	return <button onClick={this.alert.bind(this)}>This is a simple Example</button>;
	}
};

ReactDOM.render(<Example />, document.getElementById('component-example-simple'));

This is important for rendering examples on page:

React.render(<Example />, document.getElementById('component-example-YourFileName'));

readme.md

Remember to follow User-Guide of cat-component

bin

node node_modules/.bin/cat-server   //启动服务在7777端口,并且监听文件改变重新编译后刷新浏览器
node node_modules/.bin/build        //将src目录下的es6文件编译成es5,目标目录dist

You can add these in your package.json:

"scripts" : {
	"dev": "node node_modules/.bin/cat-server",
	"build": "node node_modules/.bin/build",
  "pre-publish": "node node_modules/.bin/pre-publish"
}

Then,you can run instead

npm run dev
npm run build

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

2 Versions

  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (25)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |