Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat($core): functional siteConfig.evergreen #1489

Merged
merged 2 commits into from
Mar 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,同时会带来更快的构建速度和更小的文件体积。