|
|
@@ -1,38 +1,38 @@
|
|
|
-# Compiling CSS and JavaScript []({{ site.repo }}/blob/master/docs/_i18n/{{ site.lang }}/getting-started/grunt.md)
|
|
|
+# 编译 CSS 和 JavaScript []({{ site.repo }}/blob/master/docs/_i18n/{{ site.lang }}/getting-started/grunt.md)
|
|
|
|
|
|
---
|
|
|
|
|
|
-Bootstrap table uses [Grunt](http://gruntjs.com/) for its build system, with convenient methods for working with the framework. It's how we compile our code, run tests, and more.
|
|
|
+Bootstrap table 使用 [Grunt](http://gruntjs.com/) 来作为编译系统,可以用十分方便的方法来编译我们代码,或者文档等等。
|
|
|
|
|
|
-## Installing Grunt
|
|
|
+## 安装 Grunt
|
|
|
|
|
|
-To install Grunt, you must **first** [download and install node.js](http://nodejs.org/download/) (which includes npm). npm stands for [node packaged modules](http://npmjs.org/) and is a way to manage development dependencies through node.js.
|
|
|
+安装 Grunt,你必须先 [下载和安装 node.js](http://nodejs.org/download/) (包含 npm)。npm 是 [node 的包模块](http://npmjs.org/) 管理工具。
|
|
|
|
|
|
-Then, from the command line:
|
|
|
+然后,我们使用命令行:
|
|
|
|
|
|
-1. Install `grunt-cli` globally with `npm install -g grunt-cli`.
|
|
|
-2. Navigate to the root `/bootstrap-table/` directory, then run `npm install`. npm will look at the `package.json` file and automatically install the necessary local dependencies listed there.
|
|
|
+1. 安装全局的 `grunt-cli`,使用 `npm install -g grunt-cli` 命令即可。
|
|
|
+2. 进入到 `/bootstrap-table/` 的根目录,然后运行 `npm install`。npm 将通过查找 `package.json` 文件并自动安装这里所需要的依赖。
|
|
|
|
|
|
-When completed, you'll be able to run the various Grunt commands provided from the command line.
|
|
|
+完成之后,你就可以运行一下的命令来编译的代码了。
|
|
|
|
|
|
-## Available Grunt commands
|
|
|
+## 可以用的 Grunt 命令
|
|
|
|
|
|
-### `grunt dist` (Just compile CSS and JavaScript)
|
|
|
+### `grunt dist` (编译 CSS 和 JavaScript)
|
|
|
|
|
|
-Regenerates the `/dist/` directory with compiled and minified CSS and JavaScript files. As a Bootstrap user, this is normally the command you want.
|
|
|
+这里我们会生成 `/dist/` 文件夹。 As a Bootstrap user, this is normally the command you want.
|
|
|
|
|
|
-### `grunt test` (Run tests)
|
|
|
+### `grunt test` (运行 tests)
|
|
|
|
|
|
-Runs [JSHint](http://jshint.com/) to test our code.
|
|
|
+运行 [JSHint](http://jshint.com/) 来测试我们的代码。
|
|
|
|
|
|
-### `grunt docs` (Build & test the docs assets)
|
|
|
+### `grunt docs` (编译和测试文档)
|
|
|
|
|
|
-Builds and tests CSS, JavaScript, and other assets which are used when running the documentation locally via `jekyll serve`.
|
|
|
+编译和测试 CSS,JavaScript,本地我们可以通过 `jekyll serve` 来运行我们的文档。
|
|
|
|
|
|
-### `grunt` (Build absolutely everything and run tests)
|
|
|
+### `grunt` (编译所有并运行测试)
|
|
|
|
|
|
-Compiles and minifies CSS and JavaScript, builds the documentation website, runs the HTML5 validator against the docs, regenerates the Customizer assets, and more. Requires [Jekyll](http://jekyllrb.com/docs/installation/).
|
|
|
+压缩和扰乱 CSS 和 JavaScript,测试,编译文档等等。依赖 [Jekyll](http://jekyllrb.com/docs/installation/)。
|
|
|
|
|
|
-## Troubleshooting
|
|
|
+## 遇到问题
|
|
|
|
|
|
-Should you encounter problems with installing dependencies or running Grunt commands, first delete the `/node_modules/` directory generated by npm. Then, rerun `npm install`.
|
|
|
+如果你安装或运行依赖是遇到问题,首先删除 `/node_modules/` npm 生成的文件夹。然后,再运行一次 `npm install` 即可。
|