comparison 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
comparison
equal deleted inserted replaced
136:d00036808948 137:a8939c717015
1 import { defineConfig, Plugin, UserConfigExport } from "vite"; 1 import { defineConfig, Plugin, UserConfigExport } from "vite";
2 import terser from "@rollup/plugin-terser"; 2 import terser from "@rollup/plugin-terser";
3 import rollupResolve from "@rollup/plugin-node-resolve"; 3 import rollupResolve from "@rollup/plugin-node-resolve";
4 import rollupCommonjs from "@rollup/plugin-commonjs"; 4 import rollupCommonjs from "@rollup/plugin-commonjs";
5 5
6 import rollupAlias from "@rollup/plugin-alias";
6 const config: UserConfigExport = { 7 const config: UserConfigExport = {
7 server: { 8 server: {
8 host: "0.0.0.0", 9 host: "0.0.0.0",
9 port: 8001, 10 port: 8001,
10 hmr: { port: 443 }, 11 hmr: { port: 443 },
23 // external: /^lit/, 24 // external: /^lit/,
24 plugins: [ 25 plugins: [
25 rollupResolve({ 26 rollupResolve({
26 browser: true, 27 browser: true,
27 preferBuiltins: false, 28 preferBuiltins: false,
29
28 }), 30 }),
29 rollupCommonjs(), 31 // rollupCommonjs(),
30 // terser({ 32 // terser({
31 // mangle: false, 33 // mangle: false,
32 // compress: false, 34 // compress: false,
33 // format: { 35 // format: {
34 // semicolons: false, 36 // semicolons: false,
35 // }, 37 // },
36 // }), 38 // }),
39 // rollupAlias({
40 // entries: [{ find: "promises", replacement: "__my_promises__" }],
41 // }),
37 ], 42 ],
38 }, 43 },
39 minify: false, 44 minify: false,
40 }, 45 },
41 resolve: { 46 // resolve: {
42 alias: [{ find: "rdf-canonize-native", replacement: "" }], 47 // alias: [{ find: "rdf-canonize-native", replacement: "" }],
43 }, 48 // },
44 define: { 49 // define: {
45 global: {}, 50 // global: {},
46 }, 51 // },
47 }; 52 };
48 53
49 export default defineConfig(({ command, mode }) => { 54 export default defineConfig(({ command, mode }) => {
50 if (command === "serve") { 55 if (command === "serve") {
51 (config.define as any)["process"] = { env: {} }; 56 (config.define as any)["process"] = { env: {} };