From d88bb52d030f31c0ec27f7ec84dc004b1a9b6b3e Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Tue, 7 Jun 2022 18:06:32 +0800 Subject: [PATCH] chore: lock vite@2.9.9 --- package.json | 2 +- packages/playground/ssr/package.json | 2 +- packages/uni-app-plus/vite.config.ts | 1 + packages/uni-app-vite/package.json | 2 +- .../src/vite/plugins/vitejs/plugins/css.ts | 22 +++++++++++-------- packages/vite-plugin-uni/package.json | 4 ++-- pnpm-lock.yaml | 8 +++---- 7 files changed, 23 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index a6bba295a..81ac762a4 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "semver": "^7.3.5", "ts-jest": "^27.0.3", "typescript": "4.6.4", - "vite": "^2.9.9", + "vite": "2.9.9", "vue": "3.2.37", "vue-router": "^4.0.15", "yorkie": "^2.0.0" diff --git a/packages/playground/ssr/package.json b/packages/playground/ssr/package.json index 9217edc59..ab55cdb83 100644 --- a/packages/playground/ssr/package.json +++ b/packages/playground/ssr/package.json @@ -21,6 +21,6 @@ "compression": "^1.7.4", "cypress": "^7.3.0", "serve-static": "^1.14.1", - "vite": "^2.9.9" + "vite": "2.9.9" } } diff --git a/packages/uni-app-plus/vite.config.ts b/packages/uni-app-plus/vite.config.ts index 934f49c91..2dbc7ec1a 100644 --- a/packages/uni-app-plus/vite.config.ts +++ b/packages/uni-app-plus/vite.config.ts @@ -123,6 +123,7 @@ export default defineConfig({ target: 'es2015', cssTarget, minify: true, + cssCodeSplit: false, lib: { name: 'uni-app-view', fileName: 'uni-app-view', diff --git a/packages/uni-app-vite/package.json b/packages/uni-app-vite/package.json index 8447af250..31510007a 100644 --- a/packages/uni-app-vite/package.json +++ b/packages/uni-app-vite/package.json @@ -40,7 +40,7 @@ "@vue/compiler-core": "3.2.37", "esbuild": "^0.14.27", "postcss": "^8.4.13", - "vite": "^2.9.9", + "vite": "2.9.9", "vue": "3.2.37" } } diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts index ff91ccc1d..9fdb11e71 100644 --- a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts @@ -561,15 +561,19 @@ async function compileCSS( ...postcssOptions, to: id, from: id, - map: { - inline: false, - annotation: false, - // postcss may return virtual files - // we cannot obtain content of them, so this needs to be enabled - sourcesContent: true, - // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources` - // prev: preprocessorMap, - }, + ...(devSourcemap + ? { + map: { + inline: false, + annotation: false, + // postcss may return virtual files + // we cannot obtain content of them, so this needs to be enabled + sourcesContent: true, + // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources` + // prev: preprocessorMap, + }, + } + : {}), }) // record CSS dependencies from @imports diff --git a/packages/vite-plugin-uni/package.json b/packages/vite-plugin-uni/package.json index 54992999b..7f59cb1c0 100644 --- a/packages/vite-plugin-uni/package.json +++ b/packages/vite-plugin-uni/package.json @@ -53,11 +53,11 @@ "@types/sass": "^1.16.0", "@vue/babel-plugin-jsx": "^1.1.1", "chokidar": "^3.5.3", - "vite": "^2.9.9", + "vite": "2.9.9", "vue": "3.2.37" }, "peerDependencies": { - "vite": "^2.9.9" + "vite": "2.9.9" }, "uni-app": { "compilerVersion": "3.4.13" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index afa162c54..b6e9647e2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,7 +50,7 @@ importers: semver: ^7.3.5 ts-jest: ^27.0.3 typescript: 4.6.4 - vite: ^2.9.9 + vite: 2.9.9 vue: 3.2.37 vue-router: ^4.0.15 yorkie: ^2.0.0 @@ -115,7 +115,7 @@ importers: compression: ^1.7.4 cypress: ^7.3.0 serve-static: ^1.14.1 - vite: ^2.9.9 + vite: 2.9.9 vue: 3.2.37 vue-router: ^4.0.15 vuex: ^4.0.2 @@ -229,7 +229,7 @@ importers: picocolors: ^1.0.0 postcss: ^8.4.13 rollup: ^2.59.0 - vite: ^2.9.9 + vite: 2.9.9 vue: 3.2.37 dependencies: '@dcloudio/uni-cli-shared': link:../uni-cli-shared @@ -864,7 +864,7 @@ importers: hash-sum: ^2.0.0 jsonc-parser: ^3.0.0 picocolors: ^1.0.0 - vite: ^2.9.9 + vite: 2.9.9 vue: 3.2.37 dependencies: '@babel/core': 7.17.10 -- GitLab