Skip to content

Commit

Permalink
revert "build: separate lang modules"
Browse files Browse the repository at this point in the history
This reverts commit 43c5acd.
  • Loading branch information
daflyinbed committed Dec 2, 2023
1 parent 43c5acd commit 27c59e4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { readdirSync } from "node:fs";
import { dirname, join, resolve, parse } from "node:path";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";

import legacy from "@vitejs/plugin-legacy";
import vue from "@vitejs/plugin-vue";
import { visualizer } from "rollup-plugin-visualizer";
import UnoCSS from "unocss/vite";
import { defineConfig } from "vite";

const TARGET = ["chrome70", "edge81", "firefox70", "safari12", "ios12"];
const TARGET_LANG = new Set(["enUS", "jaJP", "koKR", "zhCN", "zhTW"]);

const entries = readdirSync(
join(dirname(fileURLToPath(import.meta.url)), "src/entries/"),
);
Expand All @@ -19,7 +16,6 @@ const input: Record<string, string> = {};
for (const entry of entries) {
input[entry.replace(".ts", "")] = `src/entries/${entry}`;
}

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
Expand Down Expand Up @@ -55,10 +51,6 @@ export default defineConfig({
sourcemapBaseUrl: "https://static.prts.wiki/widgets/release/",
manualChunks(id) {
if (id.includes("sentry")) return "sentry";
if (id.includes("naive-ui/es/locales/")) {
const lang = parse(id).name;
if (TARGET_LANG.has(lang)) return `locales-${lang}`;
}
if (id.includes("naive-ui")) return "naive-ui";
if (id.includes("hammer")) return;
if (id.includes("node_modules")) return "vendor";
Expand Down

0 comments on commit 27c59e4

Please sign in to comment.