-
Notifications
You must be signed in to change notification settings - Fork 3
/
nuxt.config.ts
115 lines (108 loc) · 2.71 KB
/
nuxt.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import { URL, fileURLToPath } from "node:url";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
console.dir(process.env);
const getAuctionActive = () => {
if (process.env.VITE_APP_IS_AUCTION_ACTIVE === "true") {
return true;
}
if (process.env.VITE_APP_IS_AUCTION_ACTIVE === "false") {
return false;
}
return null;
};
const auctionActive = getAuctionActive();
console.log("auctionActive", auctionActive);
export default defineNuxtConfig({
alias: {
color: "color/index.js",
"mersenne-twister": "mersenne-twister/src/mersenne-twister.js",
},
runtimeConfig: {
public: {
walletConnectProjectId: process.env.VITE_APP_WALLET_CONNECT_PROJECT_ID,
auctionActive,
env: {
node: process.env.NODE_ENV,
build: process.env.BUILD_ENV,
},
},
},
ssr: false,
components: [
"~/components/design-system",
"~/components/layout",
"~/components",
],
// https://tailwindcss.nuxtjs.org/getting-started/setup
modules: [
"@nuxtjs/tailwindcss",
"@vueuse/nuxt",
"@pinia/nuxt",
"@nuxt/devtools",
"floating-vue/nuxt",
],
ignore:
auctionActive === true
? [
"pages/config/*",
"pages/profile/*",
"pages/proposal/*",
"pages/proposals/*",
"pages/actors.vue",
"pages/delegate.vue",
]
: auctionActive === false
? ["pages/auction.vue", "pages/rewards.vue"]
: undefined, //no router is ignored
imports: {
dirs: ["./stores"],
},
vite: {
resolve: {
alias: {
"~": fileURLToPath(new URL("./", import.meta.url)),
"@": fileURLToPath(new URL("./", import.meta.url)),
// Add any other aliases you use in your code base
// https://nuxt.com/docs/api/configuration/nuxt-config/#alias
},
},
plugins: [
AutoImport({
imports: ["vue", "vue-router"],
dirs: ["./composables"],
vueTemplate: true,
}),
Components({
dirs: [
"./components/**/*",
// Component folders that should be auto-imported
],
dts: true,
directoryAsNamespace: true,
}),
nodePolyfills({
// To exclude specific polyfills, add them to this list.
exclude: [
"fs", // Excludes the polyfill for `fs` and `node:fs`.
],
// Whether to polyfill `node:` protocol imports.
protocolImports: true,
}),
],
},
nitro: {
esbuild: {
options: {
target: "esnext",
},
},
},
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
});