Procházet zdrojové kódy

✅ build<CompareData.vue, vite.config.ts>: 打包测试

WanGxC před 1 rokem
rodič
revize
ee9fb4d219

+ 6 - 21
src/views/reportManage/dataCenter/components/CompareData.vue

@@ -1,23 +1,8 @@
-<!--<script setup lang="ts">-->
-<!--import { ref } from 'vue'-->
-<!--// 筛选条件-->
-<!--const value1 = ref([]) // 平台编号-->
-<!--const value2 = ref([])-->
-<!--const value3 = ref([])-->
-<!--const value4 = ref([])-->
-<!--const options = [-->
-<!--  {-->
-<!--    value: 'Option1',-->
-<!--    label: 'Option1',-->
-<!--  },-->
-<!--  {-->
-<!--    value: 'Option2',-->
-<!--    label: 'Option2',-->
-<!--  },-->
-<!--]-->
-<!--</script>-->
+<script setup lang="ts">
 
-<!--<template>-->
+</script>
+
+<template>
 <!--  <div class="flex gap-1.5 justify-between">-->
 <!--    <div class="flex gap-1.5">-->
 <!--      <el-select v-model="value1" multiple placeholder="平台编号" style="width: 160px">-->
@@ -37,6 +22,6 @@
 <!--      </el-select>-->
 <!--    </div>-->
 <!--  </div>-->
-<!--</template>-->
+</template>
 
-<!--<style scoped></style>-->
+<style scoped></style>

+ 8 - 3
vite.config.ts

@@ -61,9 +61,14 @@ const viteConfig = defineConfig((mode: ConfigEnv) => {
           chunkFileNames: `assets/[name].[hash].js`,
           assetFileNames: `assets/[name].[hash].[ext]`,
           compact: true,
-          manualChunks: {
-            vue: ['vue', 'vue-router', 'pinia'],
-            echarts: ['echarts'],
+          // manualChunks: {
+          //   vue: ['vue', 'vue-router', 'pinia'],
+          //   echarts: ['echarts'],
+          // },
+          manualChunks(id) {
+            if (id.includes('node_modules')) {
+              return id.toString().split('node_modules/')[1].split('/')[0].toString()
+            }
           },
         },
       },