All Projects → hawx1993 → hbuild

hawx1993 / hbuild

Licence: MIT license
⚔repaid build web/vue/react project starter kit with cli

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to hbuild

Laravel Scaffold
The base for developing awesome projects
Stars: ✭ 142 (+283.78%)
Mutual labels:  scaffold, starter-kit
laravel-scaffold-v1
The base for developing awesome projects
Stars: ✭ 15 (-59.46%)
Mutual labels:  scaffold, starter-kit
laravel-startkit
Laravel Admin Dashboard, Admin Template with Frontend Template, for scalable Laravel projects. It is to save your time when You start with new scalable Laravel projects with many features Bootstrap, cooreui, infyom admin Generator, roles and permissions, translatable models, spatie media and much more
Stars: ✭ 55 (+48.65%)
Mutual labels:  starter-kit
tm-nextjs-starter
React + Nextjs + MobX starter
Stars: ✭ 49 (+32.43%)
Mutual labels:  starter-kit
marmelad
Заготовка фронтенд проекта для продвинутых и начинающих 🤘. Хорошо подходит для поддержания единой структуры проектов в команде и легкого переиспользования готовых блоков между проектами.
Stars: ✭ 15 (-59.46%)
Mutual labels:  starter-kit
simple-react-native-starter
Simple ReactNative starter with an opinionated folder structure for mobile development.
Stars: ✭ 73 (+97.3%)
Mutual labels:  starter-kit
frontend-starter-kit-with-gulp
Frontend Starter Kit with Gulp for either Themeforest Projects or customizable projects.
Stars: ✭ 34 (-8.11%)
Mutual labels:  starter-kit
go-graphql-api-boilerplate
A Boilerplate of GraphQL API built in Go + graphql-go + gorm
Stars: ✭ 75 (+102.7%)
Mutual labels:  starter-kit
ts-scaffold
🏗 ts-scaffold - Scaffold project for Typescript projects, with Unit Tests and basic dependencies set up
Stars: ✭ 13 (-64.86%)
Mutual labels:  scaffold
wordpress-project
Generic project structure for WordPress website industrialisation.
Stars: ✭ 28 (-24.32%)
Mutual labels:  starter-kit
discord-py-heroku
Starter kit for hosting a Discord bot on Heroku
Stars: ✭ 85 (+129.73%)
Mutual labels:  starter-kit
gw-starter-kit
PEPELAC - Современный инструментарий для вёрстки и создания статичных сайтов с использованием Webpack
Stars: ✭ 30 (-18.92%)
Mutual labels:  starter-kit
react-native-ultimate-starter
A React Native Ultimate Starter - react-navigation v5 + redux-toolkits + dark and light theme and more.
Stars: ✭ 16 (-56.76%)
Mutual labels:  starter-kit
puppeteer-jest-starter
A starter-kit quipped with the minimal requirements for Puppeteer + Jest, making E2E testing a breeze.
Stars: ✭ 17 (-54.05%)
Mutual labels:  starter-kit
starter-kit-doogie-browser
Statamic Starter Kit: Doogie Browser
Stars: ✭ 39 (+5.41%)
Mutual labels:  starter-kit
nest-typescript-starter
Nest framework TypeScript starter (node.js)
Stars: ✭ 35 (-5.41%)
Mutual labels:  starter-kit
Frontend-StarterKit
Frontend StarterKit - [Gulp 4, Pug, SCSS, ES6+]
Stars: ✭ 13 (-64.86%)
Mutual labels:  starter-kit
scaffold
Scaffold for laravel
Stars: ✭ 51 (+37.84%)
Mutual labels:  scaffold
react-admin
基于React + ant-design的用作后台管理项目的脚手架
Stars: ✭ 96 (+159.46%)
Mutual labels:  starter-kit
beego-vuejs-starter-kit
Beego (GOLANG), Webpack, Sass, Vue.js, Vuex, Buefy
Stars: ✭ 32 (-13.51%)
Mutual labels:  starter-kit

About Hbuild

vuepack

Hbuild is a modern project starter kit
which allows you to build your own project by cli rapidly

Hbuild使用hbuild-cli命令行工具,全局注册后可快速生成项目启动套件。你可以使用Hbuild生成一个h5项目,或者vue项目(默认搭配react-router,可自由选择vuex),或者react项目。该套件包含如下特点:

Features

  • Vue2 / Vue-Router / Vuex (optional)
  • Hot reloading for single-file components
  • Webpack 2
  • babel (default)
  • LESS/SASS/Stylus (optional)
  • ejs/mustache/art-template (optional)
  • React / React-Router (optional)
  • zepto
  • autoprefixer (vue support)
  • mock server
  • eslint
  • Support for building multi-page applications
  • offline mode support
  • file hash

其中zepto是默认全局引入的,可直接使用。h5项目可以选择ejs,mustacheart-template模板引擎。 默认支持Babel转码。支持HMR。支持文件指纹

vue项目默认支持vue-router,react项目默认支持react-router,暂不支持直接通过命令行选择react-redux,可直接自行通过npm包安装,可以正常编译

Get Started

You'd better have node >=6 and npm >=3 and gulp >=3.9 installed:

$ npm install -g hbuild-cli
$ h init new-project

# edit files and start developing
$ npm start
# bundle all scripts and styles for production use
$ npm run build

Local Templates

when you clone this project,you can use a template on your local file system:

$ git clone [email protected]:hawx1993/hbuild.git
$ h init ./hbuild new-project

命令

$ npm run start;//本地开发模式,连接mock数据
$ npm run dev-daily;//本地开发模式,连接daily日常环境数据
$ npm run dev-pre;//本地开发模式,连接预发环境数据
$ npm run daily;//线上日常构建模式,连接daily日常环境数据
$ npm run pre;//线上预发构建模式,连接预发环境数据
$ npm run build;//线上构建模式,连接线上环境数据

编译

1.js代码默认采用Babel编译,gulp + webpack打包构建。

2.编译后的html文件默认输出到build/pages目录下,html文件名采用其在src/pages下的父级目录的文件名

3.编译后的静态资源文件(图片,字体,js文件等)存放到build/static目录下,编译支持文件hash,解决缓存问题

4.支持代码热替换,热替换失败会自动刷新整个页面

5.开发模式不对代码进行压缩,sourceMap 只针对非开发模式有效(not dev)

6.支持图片压缩

7.支持生产环境拷贝mock数据至编译目录

HTML和模板引擎

1.h5项目支持 ejs ,mustache和art-template模板引擎,默认支持zepto

2.非本地开发环境,html,js和css代码会被压缩

3.当你在pages下新建一个目录时,html文件需要手动配置一下静态资源的引用,例如在index目录下:

<script src="$$_CDNPATH_$$/index/index.js"></script>

CSS和预处理器

1.支持css预处理器LESS、SASS和stylus (optional);

2.默认采用css-in-js的方式,可在hbuild.config.js文件中配置是否单独提取css,提取出的css文件名称默认为:[name].css,name为src下less/scss/stylus文件名

3.开启提取css文件,需要在HTML中引入,引入方式同js

4.支持 屏幕适配方案,采用media-query+rem的方式,默认在common.less文件中

5.支持postcss和autoprefixer

代码检查

1.当你执行git commit的时候,会自动触发执行eslint,支持vue和react单文件组件,支持es6语法检查

其他

  • mock:mock 数据只需要接口URI路径和mock目录保持一致即可

  • 接口:接口如需根据环境来替换,需在hbuild.config.js文件和common/js/config文件进行配置

  • 支持多入口文件,可在pages下新建目录,文件名需以index开头

  • 字符串替换:$$_CDNPATH_$$会被编译替换为build/static/hash目录,$$_STATICPATH_$$会被替换为build/static/hash/assets

  • 入口文件:脚手架默认会读取pages目录下的index开头的js文件为入口文件,名称是写死的

  • 修改默认文件夹的名称,需要在hbuild.config.js文件就对应文件变量做修改

目录结构

.
├── README.md
├── build                       # 构建工具目录
│    └── gulpfile.babel.js            # gulp文件
│    └── postcss.config.js      # postcss配置文件
│    └── util.js                # gulp脚手架工具方法
│    └── hbuild.config.js       # 脚手架配置文件
├── mock                        # mock数据目录,保持和接口一样的路径即可
│   └── h5
├── package.json    
├── src                         # 源文件
│   ├── assets                  # 静态资源目录,存放图片或字体
│   │   └── logo.ico
│   ├── common                  # 共用代码目录,css目录存放公用css部分,js同理
│   │   ├── css
│   │   │   ├── common.less
│   │   │   └── common.scss
│   │   └── js
│   │       ├── api.js          # api文件
│   │       ├── config.js       # 配置文件
│   │       └── util.js         # 工具函数文件,可将公用方法存放于此
│   ├── components              # 组件目录
│   │   ├── counter             # 计数器vue组件
│   │   │   └── index.vue
│   │   ├── index               # vue组件的入口文件
│   │   │   └── index.vue
│   │   ├── meta                # h5 meta头部信息模块
│   │   │   └── index.html
│   │   ├── router              # vue路由模块
│   │   │   └── router.js
│   │   └── store               # vuex store模块
│   │       └── store.js
│   ├── lib                     # 第三方库
│   └── pages                   # 页面    
│       └── index               # 首页目录,可在pages目录下新建多个目录结构,作为多入口文件
│           ├── index.html
│           ├── index.js        # index.js/index.jsx文件为webpack的入口文件
│           ├── index.jsx
│           ├── index.less      # 样式文件在js文件中引入,可设置是否提取出css文件     
│           ├── index.scss
│           └── module          # 页面模板模块,可在index.js/jsx文件引入该模块文件
│               ├── main.jsx
│               └── main.tpl.html
└── yarn.lock

ChangeLog

view changelog

License

MIT © hawx1993

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].