feat: 修改部分插件优先级,修改分包规则
This commit is contained in:
1 parent
171af1219e
commit
aa61489517
6 files changed
+74
-73
No files matched your search
@@ -75,7 +75,7 @@ export default class PluginCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_component === undefined) {
|
if (_component === undefined) {
|
||||||
const setAlertTip = key !== "miaoDirectory" && this.globalAlertTip(`加载 ${name} 插件中`);
|
const setAlertTip = this.globalAlertTip(`加载 ${name} 插件中`);
|
||||||
_component = await getComponent();
|
_component = await getComponent();
|
||||||
setAlertTip &&
|
setAlertTip &&
|
||||||
setAlertTip(`加载 ${name} 插件完成`, {
|
setAlertTip(`加载 ${name} 插件完成`, {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// disable: {
|
// disable: {
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ const pluginConfig: Plugin = {
|
|||||||
},
|
},
|
||||||
disable: false,
|
disable: false,
|
||||||
group: [PluginGroup.default],
|
group: [PluginGroup.default],
|
||||||
func: Copy
|
func: Copy,
|
||||||
|
priority: -1
|
||||||
};
|
};
|
||||||
|
|
||||||
export default pluginConfig;
|
export default pluginConfig;
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ const pluginConfig: registerComponentOption = {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return vFiles[0].name.endsWith('html')
|
return vFiles[0].name.endsWith('html')
|
||||||
}
|
},
|
||||||
|
priority: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
export default pluginConfig
|
export default pluginConfig
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ onMounted(() => {
|
|||||||
const _name = ap.list.audios[index].name
|
const _name = ap.list.audios[index].name
|
||||||
currentFiles.value = currentFiles.value.filter(v => v.name !== _name)
|
currentFiles.value = currentFiles.value.filter(v => v.name !== _name)
|
||||||
})
|
})
|
||||||
// console.log({ ap, vueApp })
|
vueApp
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
+67
-68
@@ -1,74 +1,73 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from "@vitejs/plugin-vue";
|
||||||
import { resolve } from 'path'
|
import { resolve } from "path";
|
||||||
// import { viteSingleFile } from 'vite-plugin-singlefile'
|
// import { viteSingleFile } from 'vite-plugin-singlefile'
|
||||||
|
|
||||||
// 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: {
|
||||||
// entryFileNames: (chunkInfo) => {
|
manualChunks(id) {
|
||||||
// if (chunkInfo.name === 'main') {
|
if (id.includes("export.ts") && id.includes('plugins')) {
|
||||||
// return 'main.js'
|
return "pluginExports";
|
||||||
// }
|
}
|
||||||
// return '[name].[hash].js'
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
})
|
|
||||||
Reference in new issue
Block a user