From 19a1ab37efbf863bd899c1e0a3a50fa0a4cf913c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Fri, 29 Nov 2019 11:37:48 +0800 Subject: [PATCH] feat(cli): build package style entry --- packages/vant-cli/package.json | 2 ++ packages/vant-cli/site/desktop/App.vue | 2 +- .../site/desktop/components/Header.vue | 4 +-- .../site/mobile/components/DemoHome.vue | 2 +- packages/vant-cli/src/commands/dev.ts | 10 +++--- packages/vant-cli/src/common/constant.ts | 6 +++- .../vant-cli/src/compiler/gen-mobile-entry.ts | 9 +++-- .../src/compiler/gen-package-entry.ts | 36 +++++++++++++++++-- .../vant-cli/src/config/webpack.package.ts | 6 ++-- .../vant-cli/src/config/webpack.site.dev.ts | 11 +++--- packages/vant-cli/yarn.lock | 5 +++ 11 files changed, 66 insertions(+), 27 deletions(-) diff --git a/packages/vant-cli/package.json b/packages/vant-cli/package.json index 74eb02411..b703b7227 100644 --- a/packages/vant-cli/package.json +++ b/packages/vant-cli/package.json @@ -32,6 +32,7 @@ "@types/fs-extra": "^8.0.1", "@types/html-webpack-plugin": "^3.2.1", "@types/less": "^3.0.1", + "@types/lodash": "^4.14.149", "@types/postcss-load-config": "^2.0.0", "@types/sass": "^1.16.0", "@types/shelljs": "^0.8.6", @@ -82,6 +83,7 @@ "less": "^3.10.3", "less-loader": "^5.0.0", "lint-staged": "^9.4.2", + "lodash": "^4.17.15", "portfinder": "^1.0.25", "postcss": "^7.0.21", "postcss-loader": "^3.0.0", diff --git a/packages/vant-cli/site/desktop/App.vue b/packages/vant-cli/site/desktop/App.vue index b5c4fcffc..969f9a2a6 100644 --- a/packages/vant-cli/site/desktop/App.vue +++ b/packages/vant-cli/site/desktop/App.vue @@ -17,7 +17,7 @@ export default { data() { return { - config, + config: config.site, simulator: `mobile.html${location.hash}` }; } diff --git a/packages/vant-cli/site/desktop/components/Header.vue b/packages/vant-cli/site/desktop/components/Header.vue index d5faab095..c3b7e0cc7 100644 --- a/packages/vant-cli/site/desktop/components/Header.vue +++ b/packages/vant-cli/site/desktop/components/Header.vue @@ -10,9 +10,9 @@