java2sap
2021-12-31 ac03526ea51cb1baae67ab7dd2ee1e085f6a57a4
Update vite.config.js

增加新的组件后,vite打包报错@charset,需要增加配置
已修改1个文件
17 ■■■■■ 文件已修改
vite.config.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.js
@@ -32,5 +32,22 @@
        }
      },
    },
     //fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
    css: {
      postcss: {
        plugins: [
          {
            postcssPlugin: 'internal:charset-removal',
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === 'charset') {
                  atRule.remove();
                }
              }
            }
          }
        ],
      },
    },
  }
})