About Hbuild





Hbuild is a modern project starter kit

which allows you to build your own project by cli rapidly

Hbuild Use the hbuild-CLI command line tool to quickly generate a project startup suite after global registration. You can use Hbuild to build an H5 project, a VUE project (default with React-Router, vuex optional), or a React project. The suite contains the following features:

Features

  • Vue2 / Vue-Router / Vuex
  • Hot reloading for single-file components
  • Webpack 2
  • ES6
  • LESS
  • SASS
  • React
  • zepto
  • autoprefixer
  • mock server
  • eslint
  • Support for building multi-page applications
  • offline mode support
  • file hash

Zepto is introduced globally by default and can be used directly. The H5 project introduces the EJS template engine by default. Babel transcoding is supported by default. Support the HMR. File hash is supported to resolve cache issues.

Local Templates

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

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

compile

1. Js code is compiled by Babel and built with WebPack by default.

2. The compiled HTML file is output to the build/ Pages directory by default. The HTML file name is the name of the parent directory in the SRC/Pages directory

3. The compiled static resource files (such as images, fonts, and JS files) are stored in the build/static directory to support file hash to solve the cache problem

4. Support code hot replacement, hot replacement failure will automatically refresh the entire page

CSS

1. Supports CSS preprocessors LESS and SASS, and other CSS processors gradually

2. By default, csS-in-js is used. You can configure whether to extract the CSS separately in the hbuild.config.js file

3. Supports screen adaptation solutions in media-Query + REM mode, which are stored in common.less files by default

4. Support PostCSS and autoprefixer

The directory structure

.├ ─ ─ the README. Md ├ ─ ─ gulpfile. Js#Gulp file├ ─ ─ hbuild. Config. Js#Scaffold profile├ ─ ─ the mock#Mock data directory, keep the same path as the interface│ └ ─ ─ h5 ├ ─ ─ package. The json ├ ─ ─ the SRC#The source file│ ├ ─ ─ assets#Static resource directory for images or fonts│ ├─ ├─ common#Common code directory, CSS directory stores common CSS parts, the same as JS│ │ ├ ─ ─ CSS │ │ │ ├ ─ ─ common. Less │ │ │ └ ─ ─ common. SCSS │ │ └ ─ ─ js │ │ ├ ─ ─ API. Js#The API file│ │ ├ ─ ─ config. Js#The configuration file│ │ └ ─ ─ util. Js#Utility function files where you can store common methods│ ├ ─ ─ the components#component│ │ ├ ─ ─ counter#Counter VUE component│ ├─ ├─ ├─ exercises#Vue component entry file│ │ │ └ ─ ─ index. Vue │ │ ├ ─ ─ meta#H5 META Header module│ ├─ ├─ ├─ exercises#Vue routing module│ │ ├ ─ ├ ─ ├ ─ garbage#Vuex store module│ ├─ ├─ ├─ exercises#Third-party libraries│ └ ─ ─ pages#page│ └ ─ ─ the index#Home directory, you can create multiple directory structures under the Pages directory, as multi-entry files│ ├─ Index. HTML │ ├─ index#The index.js/index.jsx file is the entry file for webpack│ ├─ Index.jsx │ ├─ Index.less#The style file is introduced in the JS file, and you can set whether to extract the CSS file│ ├─ ├─ SCSS │ ├─#Page template module, which can be imported in the index.js/ JSX file│ ├─ ├─ ├─ ├.txt ├─ ├.txt ├─ ├.txtCopy the code