Skip to content

Commit

Permalink
feat($core): functional siteConfig.evergreen (#1489)
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma authored and ulivz committed Mar 30, 2019
1 parent cc193d5 commit 19e0569
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/@vuepress/core/lib/node/webpack/createBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ module.exports = function createBaseConfig (context, isServer) {
.loader('pug-plain-loader')
.end()

if (!siteConfig.evergreen) {
const evergreen = typeof siteConfig.evergreen === 'function'
? siteConfig.evergreen()
: siteConfig.evergreen
if (!evergreen) {
const libDir = path.join(__dirname, '..')
config.module
.rule('js')
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ module.exports = {

### evergreen

- Type: `boolean`
- Type: `boolean | Function`
- Default: `false`

Set to `true` if you are only targeting evergreen browsers. This will disable ES5 transpilation and polyfills for IE, and result in faster builds and smaller files.
2 changes: 1 addition & 1 deletion packages/docs/docs/zh/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ module.exports = {

### evergreen

- 类型: `boolean`
- 类型: `boolean | Function`
- 默认值: `false`

如果你的对象只有那些 “常青树” 浏览器,你可以将其设置成 `true`,这将会禁止 ESNext 到 ES5 的转译以及对 IE 的 polyfills,同时会带来更快的构建速度和更小的文件体积。

0 comments on commit 19e0569

Please sign in to comment.