From 1b0fd3d7bb1460bc2e8ae88ce9dd6f17658117cf Mon Sep 17 00:00:00 2001 From: shellyear Date: Fri, 8 Mar 2024 11:48:57 +0100 Subject: [PATCH] [fix] prevent showing eval warning caused by one of @kbss-cvut/s-forms packages --- vite.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index 0bdb6e69..8e6c787a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,7 +13,7 @@ export default defineConfig({ plugins: [ react(), eslintPlugin({ - cache: false, // disable eslint cache to avoid conflicts + cache: false, }), nodePolyfills(), ], @@ -22,7 +22,12 @@ export default defineConfig({ emptyOutDir: true, rollupOptions: { onwarn: (warning, defaultHandler) => { - if (warning.code === "INVALID_ANNOTATION" && warning.message.includes("*#__PURE__*")) { + // TODO: remove isFromKbssCvutPackageWarning and solve the root cause, see https://github.com/kbss-cvut/record-manager-ui/issues/113 + const isFromKbssCvutPackageWarning = + warning.code === "EVAL" && warning.message.includes("node_modules/store/plugins/lib/json2.js"); + const isRollupPureAnnotationWarning = + warning.code === "INVALID_ANNOTATION" && warning.message.includes("*#__PURE__*"); + if (isFromKbssCvutPackageWarning || isRollupPureAnnotationWarning) { return; } defaultHandler(warning);