lanceJiang 1 год назад
Родитель
Сommit
893a1e0ebc
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      vite.config.ts

+ 4 - 4
vite.config.ts

@@ -23,7 +23,7 @@ const examplePlugin = () => {
 
 	return {
 		name: 'custom-vuedraggableAndSortable',
-		transform(code, id) {
+		transform (code, id) {
 			/*eslint-disable*/
 			if (isProduction) {
 				if (/vuedraggable\.js/.test(id)) {
@@ -33,7 +33,7 @@ const examplePlugin = () => {
 					})
 				}
 				if (/sortablejs/.test(id)) {
-					return code.replace(`plugins.forEach(function (p) {
+					return code.replace(`    plugins.forEach(function (p) {
       if (p.pluginName === plugin.pluginName) {
         throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
       }
@@ -116,6 +116,7 @@ export default defineConfig(({ mode /*command,*/ }: ConfigEnv): UserConfig => {
 			proxy: {}
 		},
 		plugins: [
+			examplePlugin(),
 			// vue支持
 			vue(),
 			// JSX支持
@@ -140,8 +141,7 @@ export default defineConfig(({ mode /*command,*/ }: ConfigEnv): UserConfig => {
 				// 指定symbolId格式
 				symbolId: 'icon-[dir]-[name]'
 			}),
-			svgLoader(),
-			examplePlugin()
+			svgLoader()
 		]
 	}
 })