Skip to content

Commit

Permalink
[fix] prevent showing eval warning caused by one of @kbss-cvut/s-form…
Browse files Browse the repository at this point in the history
…s packages
  • Loading branch information
shellyear committed Mar 8, 2024
1 parent f99d114 commit 1b0fd3d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default defineConfig({
plugins: [
react(),
eslintPlugin({
cache: false, // disable eslint cache to avoid conflicts
cache: false,
}),
nodePolyfills(),
],
Expand All @@ -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);
Expand Down

0 comments on commit 1b0fd3d

Please sign in to comment.