From 3d3ad38443c635709b21ebf38122ae684a9d2686 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 22 Apr 2020 17:10:43 +0800 Subject: [PATCH] docs(cli): add srcDir config (#6109) --- packages/vant-cli/docs/config.md | 83 ++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/packages/vant-cli/docs/config.md b/packages/vant-cli/docs/config.md index 6c2b637dd..bc83205e6 100644 --- a/packages/vant-cli/docs/config.md +++ b/packages/vant-cli/docs/config.md @@ -30,8 +30,8 @@ module.exports = { // 构建配置 build: { site: { - publicPath: '/demo-ui/' - } + publicPath: '/demo-ui/', + }, }, // 文档站点配置 site: { @@ -48,21 +48,21 @@ module.exports = { items: [ { path: 'home', - title: '介绍' - } - ] + title: '介绍', + }, + ], }, { title: '基础组件', items: [ { path: 'my-button', - title: 'MyButton 按钮' - } - ] - } - ] - } + title: 'MyButton 按钮', + }, + ], + }, + ], + }, }; ``` @@ -84,9 +84,9 @@ CSS 预处理器配置,目前支持`less`和`sass`两种预处理器,默认 module.exports = { build: { css: { - preprocessor: 'sass' - } - } + preprocessor: 'sass', + }, + }, }; ``` @@ -103,9 +103,22 @@ module.exports = { module.exports = { build: { site: { - publicPath: '/demo-ui/' - } - } + publicPath: '/demo-ui/', + }, + }, +}; +``` + +### build.srcDir + +- Type: `string` +- Default: `src` + +```js +module.exports = { + build: { + srcDir: 'myDir', + }, }; ``` @@ -150,12 +163,12 @@ module.exports = { // 导航项路由 path: 'home', // 导航项文案 - title: '介绍' - } - ] - } - ] - } + title: '介绍', + }, + ], + }, + ], + }, }; ``` @@ -172,10 +185,10 @@ module.exports = { versions: [ { label: '1.x', - link: 'https://youzan.github.io/vant/1.x/' - } - ] - } + link: 'https://youzan.github.io/vant/1.x/', + }, + ], + }, }; ``` @@ -193,9 +206,9 @@ module.exports = { // 打开百度统计 ->『管理』->『代码获取』 // 找到下面这串 URL: "https://hm.baidu.com/hm.js?xxxxx" // 将 `xxxxx` 填写在 seed 中即可 - seed: 'xxxxx' - } - } + seed: 'xxxxx', + }, + }, }; ``` @@ -208,8 +221,8 @@ module.exports = { ```js module.exports = { devServer: { - port: 9000 - } + port: 9000, + }, }; ``` @@ -223,7 +236,7 @@ module.exports = { ```js module.exports = { - presets: ['@vant/cli/preset'] + presets: ['@vant/cli/preset'], }; ``` @@ -270,8 +283,8 @@ module.exports = { ```js module.exports = { plugins: { - autoprefixer: {} - } + autoprefixer: {}, + }, }; ```