Mercurial > code > home > repos > streamed-graph
view vite.config.ts @ 140:2ad4784c0d6c
update demo
author | drewp@bigasterisk.com |
---|---|
date | Mon, 08 May 2023 13:05:48 -0700 |
parents | a8939c717015 |
children | c26538ee1d1d |
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: 8002, path: "hmr", protocol: "ws" }, 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); } });