Build tools for FE
Universal front-end automation tools
Install
npm install qu-build -g
Usage
Usage: qu-build [options] Options: -v, --version output the version number -o, --output-path <path> output path -w, --watch [delay] watch file changes and rebuild -d, --dev start develop server -p, --port [port] develop server port, default is 8080 -b, --build build this project -t, --test test this project, use jest -c, --component <component> quickly create components --pwa use pwa --hash build with hash and output map.json --publicPath <publicPath> publicPath
Template Create
# vue template project qu-build --init vue project-name # multi page template project qu-build --init pages project-name
Mock
Use mockjs, mock storage directory ./src/api
, support .js
,.json
.
/** * @url /order/addOrderComment.do * */module { return success: Math < 05 ? false : true msg: '@word' code: Math < 05 ? -200 : 0 ;}
or
If you use jsonp
, request parameters increase callback
. The return data will be jsonp
.
/** * http://localhost:8080/?callback=jQuery1513158553653 */
Directory
./public # static resource directory; ./api # mock directory; ./src # development source code; ./package.json # project info ./webpack.config.js # custom webpack configuration
Config
webpack.config.js
// get webpackvar webpack = ; module { webpackConfigplugins; return webpackConfig;};