Giter Site home page Giter Site logo

gulp-react-tools's Introduction

Gulp react tools

Some basic commands for creating react components from the command line.

Installation

Run npm install gulp-react-tools. You will need gulp installed globally and locally in your project.

To configure the gulp task you will need to create a gulpfile.js (if you don't already have one in your project), and add the following:

var gulp = require('gulp');
require('gulp-react-tools')(gulp[, config]);

config is an optional object which can contain any of the following keys:

  • commandPrefix - the prefix for the gulp command. The command is in the following format gulp {PREFIX}generate --component {COMPONENT_NAME_IN_CAMEL_CASE}
  • componentDir - the directory to save new components to
  • componentStylesDir - the directory to save new component css to
  • componentTemplate - the path to the template component file, relative to gulpfile.js. This file can include tokens - see below.
  • componentStyleTemplate- the path to the template component style file, relative to gulpfile.js. This file can include tokens - see below.
  • componentName - the filename for the output component, must contain a token for the filename.
  • componentStylesName - the filename for the output component style file, must contain a token for the filename.
  • generateComponentStyles - whether to create style files for each component.
  • appendStyleImportTo - a filepath to append a style import to. False to disable.
  • appendStyleImportTemplate - the import string to append, should contain a token for the filename.

Tokens

Tokens can be used in filenames and template files. The following tokens are available:

  • {{COMPONENT}} - the upper-camel case component name. eg. "MyComponent"
  • {{COMPONENT_DASHED}} - the dashed component name. eg. "my-component"
  • {{CSS_FILE_COMMENT}} - the comment generated from appendStyleImportTemplate

gulp-react-tools's People

Contributors

tomjamesallen avatar

Watchers

 avatar

Forkers

jrfferreira

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.