GithubHelp home page GithubHelp logo

coffeecoke / cyjh-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ihhu/cyjh-cli

0.0 1.0 0.0 48 KB

可以一键生成项目目录的脚手架工具cyjh-cli

JavaScript 46.52% HTML 3.31% CSS 50.16%

cyjh-cli's Introduction

cyjh-cli介绍

cyjh-cli可以一键生成项目目录的脚手架工具

目前包含PCMobile两套项目目录模版可以选择生成

同时也可以自定义添加模版文件

cyjh-cli安裝

//安装cyjh-cli模块到全局
npm install cyjh-cli -g

//使用淘宝镜向源安装
npm install cyjh-cli -g --registry=https://registry.npm.taobao.org

//查看版本号
cyjh -V

//查看使用帮助
cyjh -h
cyjh-init -h

创建生成目录

在需要创建生成项目的文件夹下,打开cmd命令控制台,执行如下命令:

//创建项目目录并选择加载模版文件
cyjh init

//创建PC目录并加载pc端模版文件
cyjh init -P

//创建Mobile目录并加载Mobile端模版文件
cyjh init -M 

//同时创建PC和Mobile目录,并加载PC和Mobile端模版文件
cyjh init -P -M

添加自定义模版文件

  • 在需要添加模版的目录下:创建 模版文件夹模版文件,如果存在空文件夹时,请在空文件下创建名为:.empty文件
  • 执行cyjh addcyjh add <template-name>可添加当前目录模版到全局
  • 执行cyjh remove可删除模版
  • 执行cyjh init可选择添加的模版生成项目目录

自动化编译*.scss文件

生成PCMobile项目的根目录存在_FolderWatchConfig.jscompress配置文件,该配置文件是JSCompress软件(官网)配置生成的。

下载安装JSCompress软件打开后,将_FolderWatchConfig.jscompress配置文件拖入软件即可自动化编译*.scss文件

编译后的*.css文件会存放在Style/Css目录下。

自动化合并压缩*.png文件并生成相应的css文件

生成PCMobile项目的Style/Images目录下存在icon.png.jscompress配置文件。将该配置文件拖入JSCompress软件(官网)即可。

JSCompress软件会自动合并压缩Delete/Icon目录下的图片至Style/Images目录。并且会在Style/Scss目录下生成_Icon.scss文件。


要求

  • node >= 4.0
  • npm >= 3.0

cyjh-cli's People

Contributors

ihhu avatar

Watchers

James Cloos avatar

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.