From f1d72cb016acb8c080b4159be4aa75afa5d4b950 Mon Sep 17 00:00:00 2001 From: HaoChuan9421 Date: Fri, 12 Mar 2021 10:42:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(vant-cli):=20=E4=B8=BA=20README=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A2=9E=E5=8A=A0=20vue-loader=20=E4=BB=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A2=84=E8=A7=88=20demo=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vant-cli/src/config/webpack.base.ts | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/vant-cli/src/config/webpack.base.ts b/packages/vant-cli/src/config/webpack.base.ts index a6a73c26c..2cde4d6ec 100644 --- a/packages/vant-cli/src/config/webpack.base.ts +++ b/packages/vant-cli/src/config/webpack.base.ts @@ -24,6 +24,15 @@ const CSS_LOADERS = [ }, ]; +const VUE_LOADER = { + loader: 'vue-loader', + options: { + compilerOptions: { + preserveWhitespace: false, + }, + }, +}; + const plugins = [ new webpack.DefinePlugin({ __VUE_OPTIONS_API__: 'true', @@ -74,16 +83,7 @@ export const baseConfig: WebpackConfig = { rules: [ { test: /\.vue$/, - use: [ - { - loader: 'vue-loader', - options: { - compilerOptions: { - preserveWhitespace: false, - }, - }, - }, - ], + use: [VUE_LOADER], }, { test: /\.(js|ts|jsx|tsx)$/, @@ -115,7 +115,7 @@ export const baseConfig: WebpackConfig = { }, { test: /\.md$/, - use: ['@vant/markdown-loader'], + use: [VUE_LOADER, '@vant/markdown-loader'], }, ], },