1 Star 0 Fork 1

theajack / jet-js-cli

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

jet-js-cli

theajack

Jet.js 的脚手架工具,帮助您更便捷地使用Jet

Jet.js Scaffolding tools to help you use Jet.js framework more easily

Jet 是一个轻量级、渐进式的 JS MVVM框架

Jet is a lightweight, progressive JS MVVM framework

1.Installation

1.Use npm to install

npm install jet-js-cli -g

下载需要一点时间,请耐心等候

Download takes a little time, please be patient

(请使用 -g 全局安装,否则后续命令无法执行)

(Please use -g to install globally, otherwise subsequent commands cannot be executed)

2.Use

选择一个您希望建立项目的目录,命令行运行以下命令:

Select a directory where you want to build the project, and run the following command from the command line:

jet init projectName

3.Development

执行上述命令后会下载一个Jet的开发模板和相应开发环境,执行以下命令可以运行这个Jet示例程序:

After executing the above command, you will download a Jet development template and the corresponding development environment. You can run the Jet sample program by executing the following command:

cd projectName
jet run

详细Jet使用教程请参考 Jet API

For detailed Jet tutorials, please refer to [Jet API] (https://www.theajack.com/jet/)

4.Package and use in production environment

4.1 Packing Command

使用以下命令打包项目

jet build

打包完成后,会在根目录下生成一个build文件夹(如已有build文件夹,会将旧的打包文件覆盖),将build文件夹中的所有文件复制到您的生产环境中即可运行。

After the package is completed, a build folder will be generated in the root directory (such as the existing build folder, the old package file will be overwritten), and all the files in the build folder will be copied to your production environment to run.

生成build文件夹后,可以使用一下命令测试打包之后的项目能否正常工作。

After generating the build folder, you can use the following command to test whether the packaged project works properly.

cd build
jet run

实际上,您可以使用jet run命令在任一目录下启动一个http服务器,入口文件是index.html

In fact, you can use the jet run command to start an http server in any directory. The entry file is index.html

4.2 Packing configuration

在根目录中的build.config.json文件中,有以下配置项

In the build.config.json file in the root directory, there are the following configuration items.

...
"jetConfig": {
	"compressHtml": true,
	"compressCss": true,
	"compressJs": true,
	"buildJsWithBabel": false,
	"buildCssWithLess": false,
	"commonLess": false
},
...

各项参数含义如下

The meaning of each parameter is as follows

参数 默认值 描述
compressHtml true 是否压缩html文件
compressCss true 是否压缩css文件
compressJs true 是否压缩js文件
buildJsWithBabel false 是否将es6转为es5
buildCssWithLess false 是否将less转为css
commonLess false 是否将common.css文件作为less文件编译

Parameters Defaults Description
compressHtml true whether to compress html files
compressCss true Currently compress css files
compressJs true whether to compress js files
buildJsWithBabel false Whether to convert es6 to es5
buildCssWithLess false Whether to turn less to css
commonLess false Whether to compile the common.css file as a less file

-备注1:若您在开发中使用es6或less,请引入相应的官方库,详细教程请参考 Jet APi. -备注2:当设置了 buildJsWithBabel 或 buildCssWithLess 为true 时,compressHtml参数会强制使用true ,这是因为需要处理html文件中的js和css代码。

  • Note 1: If you use es6 or less in development, please introduce the corresponding official library. For detailed tutorials, please refer to [Jet APi] (https://www.jet-js.com).
  • Note 2: When buildJsWithBabel or buildCssWithLess is set to true, the compressHtml parameter forces true, which is due to the need to process the js and css code in the html file.
The MIT License (MIT) Copyright (c) 2018 theajack Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Jet 的脚手架工具,帮助您更便捷地使用Jet 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/theajack/jet-js-cli.git
git@gitee.com:theajack/jet-js-cli.git
theajack
jet-js-cli
jet-js-cli
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891