Skip to content

Commit

Permalink
(chore) Ignore harmless wyw-in-js issues (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Nov 3, 2024
1 parent f11fd6b commit d900c3b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import { defineConfig } from "vitest/config";

import compilerOptions from "./compilerOptions";

const IGNORED_ROLLUP_WARNINGS = [
// https://github.com/Anber/wyw-in-js/issues/62
"contains an annotation that Rollup cannot interpret due to the position of the comment",
"The comment will be removed to avoid issues.",

// https://github.com/vitejs/vite/blob/fe30349d350ef08bccd56404ccc3e6d6e0a2e156/packages/vite/rollup.config.ts#L71
"Circular dependency",
];

const manifest = JSON.parse(readFileSync("./manifest.json", "utf-8"));

// https://vitejs.dev/config/
Expand Down Expand Up @@ -65,6 +74,13 @@ export default defineConfig({
build: {
chunkSizeWarningLimit: 5_000,
rollupOptions: {
onwarn: (log, handler) => {
for (const msg in IGNORED_ROLLUP_WARNINGS) {
if (log.message.includes(msg)) return;
}

handler(log);
},
output: {
manualChunks: () => "index.js",

Expand Down

0 comments on commit d900c3b

Please sign in to comment.