-
Notifications
You must be signed in to change notification settings - Fork 198
Expand file tree
/
Copy pathvite.config.js
More file actions
39 lines (35 loc) · 881 Bytes
/
vite.config.js
File metadata and controls
39 lines (35 loc) · 881 Bytes
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
import { mergeDeepRight } from "ramda";
import { alias } from "./config/build/config";
import { define, entryPoints, extensions } from "./config/build/constants";
import svgr from "vite-plugin-svgr";
const postCssConfig = require("./postcss.config");
const port = process.env.DEVSERVER_PORT || 8000;
const baseConfig = {
assetsInclude: ["**/*.yaml"],
css: { postcss: postCssConfig },
server: { port, origin: `http://localhost:${port}` },
build: {
manifest: true,
sourcemap: true,
cssCodeSplit: false,
},
root: "app/javascript/packs",
resolve: {
alias,
},
define,
plugins: [
svgr({
svgrOptions: { exportType: "default" },
include: "**/*.svg",
}),
],
};
const viteConfig = mergeDeepRight(baseConfig, {
resolve: {
alias,
extensions,
},
rollupOptions: { input: entryPoints },
});
module.exports = viteConfig;