Mercurial > code > home > repos > streamed-graph
view vite.config.ts @ 135:a6490559ce73
WIP trying to make a usable release module
author | drewp@bigasterisk.com |
---|---|
date | Sat, 06 May 2023 14:16:01 -0700 |
parents | 8a30f1c9a702 |
children | a8939c717015 |
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"; 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, // }, // }), ], }, 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); } });