-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
51 lines (42 loc) · 1.48 KB
/
vite.config.js
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
import path from 'path'
import { sveltekit } from "@sveltejs/kit/vite";
// import { plugin as markdown, Mode } from "vite-plugin-markdown";
import { config as dotenvconf } from "dotenv"
dotenvconf()
console.log('Use Local?:', process.env.PUBLIC_LOCAL)
/** @type {import("vite").UserConfig} */
const config = {
plugins: [
sveltekit({
extensions: ['.svelte', '.svx'],
}),
],
ssr: {
noExternal: ['prismjs', 'prism-svelte'],
},
// css: {
// preprocessorOptions: {
// scss: {
// additionalData: "@use \"src/app.scss\" as *;"
// }
// }
// },
resolve: {
symlinks: true,
alias: {
// these are the aliases and paths to them
$src: path.resolve('./src'),
$routes: path.resolve('./src/routes'),
$instill: path.resolve('./src/routes/instill'),
$plasmid: process.env.PUBLIC_LOCAL == 'local' ? path.resolve('/src/plasmid') : path.resolve('/node_modules/plasmid'), // dynamic linked
// $plasmid: path.resolve('./src/plasmid'), // local linked
// $plasmid: path.resolve('./node_modules/plasmid'), // git linked
'$instill-helpers': process.env.PUBLIC_LOCAL == 'local' ? path.resolve('./src/plasmid/modules/instill-helpers') : path.resolve('./node_modules/plasmid/modules/instill-helpers'), // dynamic linked
$modules: path.resolve('./node_modules'),
}
},
// optimizeDeps: {
// include: ['./src/lib/cytosis2/*.js', './src/lib/cytosis2/*.json',],
// },
};
export default config;