feat: 修改部分插件优先级,修改分包规则
This commit is contained in:
1 parent
171af1219e
commit
aa61489517
6 files changed
+42
-41
No files matched your search
@@ -75,7 +75,7 @@ export default class PluginCenter {
|
||||
}
|
||||
|
||||
if (_component === undefined) {
|
||||
const setAlertTip = key !== "miaoDirectory" && this.globalAlertTip(`加载 ${name} 插件中`);
|
||||
const setAlertTip = this.globalAlertTip(`加载 ${name} 插件中`);
|
||||
_component = await getComponent();
|
||||
setAlertTip &&
|
||||
setAlertTip(`加载 ${name} 插件完成`, {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
// disable: {
|
||||
|
||||
@@ -18,7 +18,8 @@ const pluginConfig: Plugin = {
|
||||
},
|
||||
disable: false,
|
||||
group: [PluginGroup.default],
|
||||
func: Copy
|
||||
func: Copy,
|
||||
priority: -1
|
||||
};
|
||||
|
||||
export default pluginConfig;
|
||||
|
||||
@@ -15,7 +15,8 @@ const pluginConfig: registerComponentOption = {
|
||||
return false
|
||||
}
|
||||
return vFiles[0].name.endsWith('html')
|
||||
}
|
||||
},
|
||||
priority: 2
|
||||
}
|
||||
|
||||
export default pluginConfig
|
||||
|
||||
@@ -86,7 +86,7 @@ onMounted(() => {
|
||||
const _name = ap.list.audios[index].name
|
||||
currentFiles.value = currentFiles.value.filter(v => v.name !== _name)
|
||||
})
|
||||
// console.log({ ap, vueApp })
|
||||
vueApp
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
+35
-36
@@ -1,74 +1,73 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { resolve } from 'path'
|
||||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { resolve } from "path";
|
||||
// import { viteSingleFile } from 'vite-plugin-singlefile'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
base: "./",
|
||||
plugins: [
|
||||
vue()
|
||||
// viteSingleFile()
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, 'src')
|
||||
"@": resolve(__dirname, "src")
|
||||
}
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/get': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/get": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/get/, '/get')
|
||||
rewrite: path => path.replace(/^\/get/, "/get")
|
||||
},
|
||||
|
||||
'/upload': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/upload": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/upload/, '/upload')
|
||||
rewrite: path => path.replace(/^\/upload/, "/upload")
|
||||
},
|
||||
|
||||
'/delete': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/delete": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/delete/, '/delete')
|
||||
rewrite: path => path.replace(/^\/delete/, "/delete")
|
||||
},
|
||||
'/query': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/query": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/query/, '/query')
|
||||
rewrite: path => path.replace(/^\/query/, "/query")
|
||||
},
|
||||
'/rename': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/rename": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/rename/, '/rename')
|
||||
rewrite: path => path.replace(/^\/rename/, "/rename")
|
||||
},
|
||||
'/cut': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/cut": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/cut/, '/cut')
|
||||
rewrite: path => path.replace(/^\/cut/, "/cut")
|
||||
},
|
||||
'/mkdir': {
|
||||
target: 'http://127.0.0.1:17705',
|
||||
"/mkdir": {
|
||||
target: "http://127.0.0.1:17705",
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/mkdir/, '/mkdir')
|
||||
rewrite: path => path.replace(/^\/mkdir/, "/mkdir")
|
||||
}
|
||||
}
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: 'index.html'
|
||||
main: "index.html"
|
||||
},
|
||||
// output: {
|
||||
// entryFileNames: (chunkInfo) => {
|
||||
// if (chunkInfo.name === 'main') {
|
||||
// return 'main.js'
|
||||
// }
|
||||
// return '[name].[hash].js'
|
||||
// }
|
||||
// }
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes("export.ts") && id.includes('plugins')) {
|
||||
return "pluginExports";
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user