diff --git a/packages/sw/vite.config.ts b/packages/sw/vite.config.ts index 235ae1d6e8..fb41c89148 100644 --- a/packages/sw/vite.config.ts +++ b/packages/sw/vite.config.ts @@ -8,15 +8,26 @@ import viteCompression from "vite-plugin-compression"; export default defineConfig({ mode: isProduction ? "production" : "development", build: { - target: "modules", - outDir: "../../built/_sw_dist_", - assetsDir: "", + target: ["chrome87", "firefox78", "safari14", "es2017"], + manifest: "manifest.json", rollupOptions: { - input: "./src/sw.ts", + input: { + app: "./src/sw.ts", + }, output: { entryFileNames: "sw.js", }, }, + cssCodeSplit: true, + assetsInlineLimit: 0, + outDir: `${__dirname}/../../built/_sw_dist_`, + assetsDir: ".", + emptyOutDir: false, + sourcemap: process.env.NODE_ENV === "development", + reportCompressedSize: false, + commonjsOptions: { + include: [/firefish-js/, /node_modules/], + }, }, resolve: { alias: {