# 部署

## 部署中遇到的问题

#### 通过capistrano部署代码时，报UglifyJs错误

这个问题，通常是因为UglifyJs不支持ES2015语法，而一些npm包中又有这种新语法，导致编译失败。

临时解决办法：删除UglifyJs插件

{% code title="config/webpack/production.js" %}

```javascript
const environment = require('./environment')
environment.plugins.delete("UglifyJs")
module.exports = environment.toWebpackConfig()
```

{% endcode %}

**或者：**

添加`babel-present-stage-2`, 关闭uglify

```bash
yarn add babel-present-stage-2
```

配置`.babelrc`

```javascript
{
  "presets": [
    ["env", {
      "modules": false,
      "targets": {
        "browsers": "> 1%",
        "uglify": false
      },
      "useBuiltIns": true
    }],
    "stage-2"
  ],
  ...
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.tanmer.cn/gem/ruby-on-rails/bu-shu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
