fix: 1.取消歌单懒加载 2.修改vite打包时chunk文件命名规则
This commit is contained in:
1 parent
53ab0ad45b
commit
9611e9f4ed
2 files changed
+72
-68
No files matched your search
@@ -2,8 +2,8 @@
|
|||||||
<ol :style="{ maxHeight: ap.options.listMaxHeight }" :key="refreshKey" ref="ol">
|
<ol :style="{ maxHeight: ap.options.listMaxHeight }" :key="refreshKey" ref="ol">
|
||||||
<VueDraggable v-model="ap.list.audios" @start="onDragStart" @end="onDragEnd" item-key="id"
|
<VueDraggable v-model="ap.list.audios" @start="onDragStart" @end="onDragEnd" item-key="id"
|
||||||
handle=".aplayer-list-control-btn-reorder" ghostClass="iSDragging" :animation="150">
|
handle=".aplayer-list-control-btn-reorder" ghostClass="iSDragging" :animation="150">
|
||||||
<miaoLazyDiv v-for="(element, index) in ap.list.audios" :min-height="'32px'" auto-height>
|
<!-- <miaoLazyDiv :min-height="'32px'" auto-height> -->
|
||||||
<li :class="activeAudioIndex == index ? 'aplayer-list-light' : ''" class="aplayer-list-new"
|
<li v-for="(element, index) in ap.list.audios" :class="activeAudioIndex == index ? 'aplayer-list-light' : ''" class="aplayer-list-new"
|
||||||
:key="element.id">
|
:key="element.id">
|
||||||
<span class="aplayer-list-cur" :style="{ backgroundColor: apTheme }"></span>
|
<span class="aplayer-list-cur" :style="{ backgroundColor: apTheme }"></span>
|
||||||
<span class="aplayer-list-index">{{ index + 1 }}</span>
|
<span class="aplayer-list-index">{{ index + 1 }}</span>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<span class="aplayer-list-author" v-show="element.artist !== 'Audio artist1'">{{ element.artist
|
<span class="aplayer-list-author" v-show="element.artist !== 'Audio artist1'">{{ element.artist
|
||||||
}}</span>
|
}}</span>
|
||||||
</li>
|
</li>
|
||||||
</miaoLazyDiv>
|
<!-- </miaoLazyDiv> -->
|
||||||
</VueDraggable>
|
</VueDraggable>
|
||||||
</ol>
|
</ol>
|
||||||
</template>
|
</template>
|
||||||
@@ -43,7 +43,8 @@
|
|||||||
import { computed, nextTick, onMounted, ref } from 'vue';
|
import { computed, nextTick, onMounted, ref } from 'vue';
|
||||||
import { ChevronUpOutline, ChevronDownOutline, CloseOutline, ReorderFourOutline, PlayOutline, HeartOutline } from '@vicons/ionicons5';
|
import { ChevronUpOutline, ChevronDownOutline, CloseOutline, ReorderFourOutline, PlayOutline, HeartOutline } from '@vicons/ionicons5';
|
||||||
import { VueDraggable } from 'vue-draggable-plus'
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
import miaoLazyDiv from '@/components/miaoLazyDiv.vue';
|
// 与vue-draggable冲突
|
||||||
|
// import miaoLazyDiv from '@/components/miaoLazyDiv.vue';
|
||||||
import apType, { audioType } from '../types/ap';
|
import apType, { audioType } from '../types/ap';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
+67
-64
@@ -5,69 +5,72 @@ import { resolve } from "path";
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: "./",
|
base: './',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue()
|
vue()
|
||||||
// viteSingleFile()
|
// viteSingleFile()
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": resolve(__dirname, "src")
|
'@': resolve(__dirname, 'src')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
"/get": {
|
'/get': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/get/, "/get")
|
rewrite: (path) => path.replace(/^\/get/, '/get')
|
||||||
},
|
},
|
||||||
|
|
||||||
"/upload": {
|
'/upload': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/upload/, "/upload")
|
rewrite: (path) => path.replace(/^\/upload/, '/upload')
|
||||||
},
|
},
|
||||||
|
|
||||||
"/delete": {
|
'/delete': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/delete/, "/delete")
|
rewrite: (path) => path.replace(/^\/delete/, '/delete')
|
||||||
},
|
},
|
||||||
"/query": {
|
'/query': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/query/, "/query")
|
rewrite: (path) => path.replace(/^\/query/, '/query')
|
||||||
},
|
},
|
||||||
"/rename": {
|
'/rename': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/rename/, "/rename")
|
rewrite: (path) => path.replace(/^\/rename/, '/rename')
|
||||||
},
|
},
|
||||||
"/cut": {
|
'/cut': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/cut/, "/cut")
|
rewrite: (path) => path.replace(/^\/cut/, '/cut')
|
||||||
},
|
},
|
||||||
"/mkdir": {
|
'/mkdir': {
|
||||||
target: "http://127.0.0.1:17705",
|
target: 'http://127.0.0.1:17705',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/mkdir/, "/mkdir")
|
rewrite: (path) => path.replace(/^\/mkdir/, '/mkdir')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
input: {
|
input: {
|
||||||
main: "index.html"
|
main: 'index.html'
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
manualChunks(id) {
|
entryFileNames: 'assets/[name]-[hash].js',
|
||||||
if (id.includes("export.ts") && id.includes('plugins')) {
|
chunkFileNames: 'assets/chunk-[name]-[hash].js',
|
||||||
return "pluginExports";
|
assetFileNames: 'assets/[name]-[hash][extname]',
|
||||||
}
|
manualChunks(id) {
|
||||||
}
|
if (id.includes('export.ts') && id.includes('plugins')) {
|
||||||
}
|
return 'pluginExports'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Reference in new issue
Block a user