-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
71 lines (69 loc) · 1.85 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { defineConfig } from "vite";
import {
BuildAngularPlugin,
AngularLinkerPlugin,
ProvideStandaloneFilesPlugin,
GlobalStylesPlugin,
} from "./plugins";
import * as path from "path";
const standaloneFiles = [
{ filePath: "src/sw.js", fileType: "text/javascript", route: "/sw.js" },
{
filePath: "src/manifest.webmanifest",
fileType: "application/manifest+json",
route: "/manifest.webmanifest",
},
];
const serverUrlMapping = {
staging: "https://api-staging.send-hug.com",
production: "https://api.send-hug.com",
};
export default defineConfig(({ mode }) => ({
plugins: [
AngularLinkerPlugin(),
BuildAngularPlugin(),
ProvideStandaloneFilesPlugin(standaloneFiles, serverUrlMapping, mode),
GlobalStylesPlugin("src/styles", "styles.less"),
],
server: {
port: 3000,
watch: {
ignored: ["**/coverage/**"],
},
},
optimizeDeps: {
exclude: ["/__web-dev-server__web-socket.js", "@web/test-runner-core"],
},
css: {
preprocessorOptions: {
less: {
additionalData: '@import "@/styles/styles.less";',
},
},
},
build: {
sourcemap: false,
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("polyfill.js") || id.includes("zone.js")) {
return "polyfills";
} else if (id.includes("node_modules")) {
return "vendor";
}
},
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@app": path.resolve(__dirname, "./src/app"),
"@admin": path.resolve(__dirname, "./src/app/admin"),
"@forms": path.resolve(__dirname, "./src/app/components/forms"),
"@common": path.resolve(__dirname, "./src/app/components/common"),
"@routes": path.resolve(__dirname, "./src/app/routes"),
"@tests": path.resolve(__dirname, "./src/tests"),
},
},
}));