-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
44 lines (40 loc) · 972 Bytes
/
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
import { defineConfig } from "vite"
import * as path from "path"
import { viteStaticCopy } from "vite-plugin-static-copy"
import Rails from "vite-plugin-rails"
const mode = process.env.NODE_ENV || "development"
const paths = {
production: "",
development: "-dev",
test: "-test"
}
const vitePath = `public/vite${paths[mode]}/assets`
export default defineConfig({
plugins: [
viteStaticCopy({
targets: [
{
src: 'node_modules/@shoelace-style/shoelace/dist/assets',
dest: vitePath
}
]
}),
Rails()
],
resolve: {
alias: [
{
find: "@/lib",
replacement: path.resolve(__dirname, "./app/frontend/components/lib/")
},
{
find: "@/components",
replacement: path.resolve(__dirname, "./app/frontend/components/")
},
{
find: "@/entrypoints",
replacement: path.resolve(__dirname, "./app/frontend/entrypoints")
}
]
},
})