Skip to content
索引

vite-plugin-pwa

什么是pwa

https://zhuanlan.zhihu.com/p/40236256

unplugin-vue-components

使用按需加载element-plus组件库样式的写法导致页面卡顿厉害

https://github.com/antfu/unplugin-vue-components/issues/361

完善vxe-table自动导入

https://github.com/antfu/unplugin-vue-components/blob/main/src/core/resolvers/element-ui.ts

https://cn.vitejs.dev/guide/api-plugin.html#plugin-ordering

https://juejin.cn/post/7075678169122439181

https://github.com/antfu/unplugin-auto-import

https://github.com/antfu/unplugin-auto-import/pull/23/files

js
  Components({
        resolvers: [
          (componentName) => {
            console.log('componentName', componentName);
            if (componentName.startsWith('Vxe'))
              return { name: componentName.slice(3), from: 'vxe-table' };
          },
        ],
      }),
  Components({
        resolvers: [
          (componentName) => {
            console.log('componentName', componentName);
            if (componentName.startsWith('Vxe'))
              return { name: componentName.slice(3), from: 'vxe-table' };
          },
        ],
      }),

控制vite在浏览器显示的报错信息

js
export function eslintPlugin() {
  return {
    name: 'eslint',
    transform(code, id) {
      if (/src\/main.js$/.test(id)) {
        this.error('识别src/main.js出错');
      }
    },
  };
}
export function eslintPlugin() {
  return {
    name: 'eslint',
    transform(code, id) {
      if (/src\/main.js$/.test(id)) {
        this.error('识别src/main.js出错');
      }
    },
  };
}

Released under the MIT License.