|
@@ -3,11 +3,28 @@ import uni from '@dcloudio/vite-plugin-uni';
|
|
import path from 'path';
|
|
import path from 'path';
|
|
// import viteCompression from 'vite-plugin-compression';
|
|
// import viteCompression from 'vite-plugin-compression';
|
|
import uniReadPagesV3Plugin from './sheep/router/utils/uni-read-pages-v3';
|
|
import uniReadPagesV3Plugin from './sheep/router/utils/uni-read-pages-v3';
|
|
|
|
+// 引入直播组件
|
|
|
|
+import replaceManifest from './modifyManifest'
|
|
|
|
+
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
// https://vitejs.dev/config/
|
|
export default (command, mode) => {
|
|
export default (command, mode) => {
|
|
const env = loadEnv(mode, __dirname, 'SHOPRO_');
|
|
const env = loadEnv(mode, __dirname, 'SHOPRO_');
|
|
-
|
|
|
|
|
|
+ if (env.SHOPRO_MPLIVE_ON === 'true') {
|
|
|
|
+ replaceManifest(`{
|
|
|
|
+ "live-player-plugin": {
|
|
|
|
+ "version": "1.3.5",
|
|
|
|
+ "provider": "wx2b03c6e691cd7370"
|
|
|
|
+ }
|
|
|
|
+ }`, 'push')
|
|
|
|
+ } else {
|
|
|
|
+ replaceManifest(`{
|
|
|
|
+ "live-player-plugin": {
|
|
|
|
+ "version": "1.3.5",
|
|
|
|
+ "provider": "wx2b03c6e691cd7370"
|
|
|
|
+ }
|
|
|
|
+ }`, 'delete')
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
envPrefix: "SHOPRO_",
|
|
envPrefix: "SHOPRO_",
|
|
plugins: [
|
|
plugins: [
|