Browse Source

pc移除px插件

Lechan Dai 2 năm trước cách đây
mục cha
commit
36ce4d3a18
3 tập tin đã thay đổi với 55 bổ sung28 xóa
  1. 0 9
      postcss.config.js
  2. 36 0
      src/pc/components_pc.d.ts
  3. 19 19
      vite.config.h5.ts

+ 0 - 9
postcss.config.js

@@ -1,9 +0,0 @@
-var pxtoviewport = require("postcss-px-to-viewport");
-
-module.exports = {
-  plugins: [pxtoviewport({
-    viewportWidth: 375,
-    propList: ['*'],
-    include:/\/node_modules\/vant/
-  })],
-};

+ 36 - 0
src/pc/components_pc.d.ts

@@ -0,0 +1,36 @@
+// generated by unplugin-vue-components
+// We suggest you to commit this file into source control
+// Read more: https://github.com/vuejs/core/pull/3399
+import '@vue/runtime-core'
+
+export {}
+
+declare module '@vue/runtime-core' {
+  export interface GlobalComponents {
+    Feature: typeof import('./components/Feature.vue')['default']
+    Features: typeof import('./components/Features.vue')['default']
+    Hero: typeof import('./components/Hero.vue')['default']
+    HomeNew: typeof import('./pages/home/_components/home-new.vue')['default']
+    HomeTags: typeof import('./pages/home/_components/home-tags.vue')['default']
+    LayoutBasic: typeof import('./components/layout-basic/layout-basic.vue')['default']
+    LayoutUser: typeof import('./components/layout-user/layout-user.vue')['default']
+    LayoutUserHeader: typeof import('./components/layout-user/layout-user-header.vue')['default']
+    LayoutUserMenu: typeof import('./components/layout-user/layout-user-menu.vue')['default']
+    Navbar: typeof import('./components/Navbar.vue')['default']
+    RouterLink: typeof import('vue-router')['RouterLink']
+    RouterView: typeof import('vue-router')['RouterView']
+    UiDevider: typeof import('./components/ui-devider/ui-devider.vue')['default']
+    UiInput: typeof import('./components/ui-input/ui-input.vue')['default']
+    UiMainArticle: typeof import('./components/ui-main-article/ui-main-article.vue')['default']
+    UiNavBar: typeof import('./components/ui-nav-bar/ui-nav-bar.vue')['default']
+    UiOrderTable: typeof import('./components/ui-order-table/ui-order-table.vue')['default']
+    UiPortal: typeof import('./components/ui-portal/ui-portal.vue')['default']
+    UiShadowBox: typeof import('./components/ui-shadow-box/ui-shadow-box.vue')['default']
+    UiSmallArticle: typeof import('./components/ui-small-article/ui-small-article.vue')['default']
+    UiSwiper: typeof import('./components/ui-swiper/ui-swiper.vue')['default']
+    UiTitleDevider: typeof import('./components/ui-title-devider/ui-title-devider.vue')['default']
+    UiVipArticle: typeof import('./components/ui-vip-article/ui-vip-article.vue')['default']
+    UiVipPreset: typeof import('./components/ui-vip-preset/ui-vip-preset.vue')['default']
+    UserAccountSettingInfoItem: typeof import('./pages/user/_components/user-account-setting-info-item.vue')['default']
+  }
+}

+ 19 - 19
vite.config.h5.ts

@@ -1,37 +1,37 @@
-import path from "path";
 import { defineConfig, loadConfigFromFile, loadEnv } from "vite";
-import vue from "@vitejs/plugin-vue2";
-import WindiCSS from "vite-plugin-windicss";
+
 import Components from "unplugin-vue-components/vite";
-import { ElementUiResolver } from "unplugin-vue-components/resolvers";
-import Icons from "unplugin-icons/vite";
-import IconsResolver from "unplugin-icons/resolver";
-import AutoImport from "unplugin-auto-import/vite";
+var pxtoviewport = require("postcss-px-to-viewport");
 
 const config = defineConfig(({ command, mode, ssrBuild }) => {
-
-  
-
   return {
-   
-
     plugins: [
-
       Components({
-        dirs: ["src/h5/components","src/common/components", "src/h5/pages/**/_components"],
-        resolvers: [
-          
+        dirs: [
+          "src/h5/components",
+          "src/common/components",
+          "src/h5/pages/**/_components",
         ],
+        resolvers: [],
         dts: "src/h5/components.d.ts",
       }),
-
-
     ],
 
     server: {
       port: 3333,
     },
-  }
+    css: {
+      postcss: {
+        plugins: [
+          pxtoviewport({
+            viewportWidth: 375,
+            propList: ["*"],
+            include: /\/node_modules\/vant/,
+          }),
+        ],
+      },
+    },
+  };
 });
 
 export default config;