qu-build
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 for webpack
--devtool <devtool> sourcemap generate method, default is null
--config <path> custom config path, default is webpack.config.js
--cwd <path> custom context path
--no-compress build without compress
--json running webpack with --json, ex. result.json
--verbose run with more logging messages.
--init <template> <project> generate a new project from a template. template: [vue, pages]
-h, --help output usage information
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.exports = function (req) {
return {
success: Math.random() < 0.5 ? false : true,
msg: '@word',
code: Math.random() < 0.5 ? -200 : 0,
};
}
or
{
"msg": "@word",
"code": 200,
}
If you use jsonp, request parameters increase callback. The return data will be jsonp.
/**
* http://localhost:8080/?callback=jQuery1513158553653
*/
jQuery1513158553653({
"msg": "abc",
"code": 200,
})
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 webpack
var webpack = require('qu-build/lib/webpack');
module.exports = function(webpackConfig) {
webpackConfig.plugins.push(
new webpack.DefinePlugin({
__DEV__: JSON.stringify('true')
});
);
return webpackConfig;
};
Related Packages
duplicate-dependencies-webpack-plugin
webpack plugin to find duplicated dependencies from your bundle
332,104
6
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.2.0 | ^2.5.17 | MIT | |
| 2.1.5 | ^2.5.17 | MIT | |
| 2.1.4 | ^2.5.17 | MIT | |
| 2.1.3 | ^2.5.17 | MIT | |
| 2.1.2 | ^2.5.17 | MIT | |
| 2.1.1 | ^2.5.17 | MIT | |
| 2.1.0 | ^2.5.17 | MIT | |
| 2.0.2 | ^2.5.16 | MIT | |
| 2.0.1 | ^2.5.16 | MIT | |
| 2.0.0 | ^2.5.16 | MIT | |
| 1.5.15 | ^2.5.16 | MIT | |
| 1.5.14 | ^2.5.16 | MIT | |
| 1.5.13 | ^2.5.16 | MIT | |
| 1.5.12 | ^2.5.16 | MIT | |
| 1.5.11 | ^2.5.16 | MIT | |
| 1.5.10 | ^2.5.16 | MIT | |
| 1.5.9 | ^2.5.16 | MIT | |
| 1.5.8 | ^2.5.16 | MIT | |
| 1.5.7 | ^2.5.16 | MIT | |
| 1.5.6 | ^2.5.16 | MIT | |
| 1.5.2 | ^2.5.16 | MIT | |
| 1.5.1 | ^2.5.16 | MIT | |
| 1.4.7 | ^2.5.16 | MIT | |
| 1.4.6 | ^2.5.16 | MIT | |
| 1.4.5 | ^2.5.13 | MIT | |
| 1.4.4 | ^2.5.13 | MIT | |
| 1.4.3 | ^2.5.13 | MIT | |
| 1.4.2 | MIT | ||
| 1.4.1 | MIT | ||
| 1.4.0 | MIT |
Showing the latest 30 of 59. See every release on npm
Pre-releases (7)
| Version | Released | Vue | License |
|---|---|---|---|
| 2.1.0-beta.2 | ^2.5.16 | MIT | |
| 2.1.0-beta.1 | ^2.5.16 | MIT | |
| 2.0.0-beta.4 | ^2.5.16 | MIT | |
| 2.0.0-beta.3 | ^2.5.16 | MIT | |
| 2.0.0-beta.2 | ^2.5.16 | MIT | |
| 2.0.0-beta.1 | ^2.5.16 | MIT | |
| 2.0.0-beta.0 | ^2.5.16 | MIT |