Mercurial > code > home > repos > streamed-graph
view vite.config.ts @ 137:a8939c717015
still trying to get build right, but there are other update bugs too
author | drewp@bigasterisk.com |
---|---|
date | Sat, 06 May 2023 15:34:40 -0700 |
parents | a6490559ce73 |
children | 2ad4784c0d6c |
line wrap: on
line source
import { defineConfig, Plugin, UserConfigExport } from "vite"; import terser from "@rollup/plugin-terser"; import rollupResolve from "@rollup/plugin-node-resolve"; import rollupCommonjs from "@rollup/plugin-commonjs"; import rollupAlias from "@rollup/plugin-alias"; const config: UserConfigExport = { server: { host: "0.0.0.0", port: 8001, hmr: { port: 443 }, fs: { allow: ["src", "node_modules", "."], }, }, build: { target: "esnext", lib: { entry: "src/index.ts", formats: ["es", "cjs", "iife"], name: "streamedgraph", }, rollupOptions: { // external: /^lit/, plugins: [ rollupResolve({ browser: true, preferBuiltins: false, }), // rollupCommonjs(), // terser({ // mangle: false, // compress: false, // format: { // semicolons: false, // }, // }), // rollupAlias({ // entries: [{ find: "promises", replacement: "__my_promises__" }], // }), ], }, minify: false, }, // resolve: { // alias: [{ find: "rdf-canonize-native", replacement: "" }], // }, // define: { // global: {}, // }, }; export default defineConfig(({ command, mode }) => { if (command === "serve") { (config.define as any)["process"] = { env: {} }; return config; } else if (command === "build") { return config; } else { throw new Error(command); } });