forked from honzabilek4/app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
38 lines (33 loc) · 1023 Bytes
/
vue.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
if (!process.env.API_URL && process.env.NODE_ENV === 'development') {
console.log(`
⚠️ No API URL passed. Using the demo API as a fallback.
`);
}
module.exports = {
lintOnSave: false,
publicPath: process.env.NODE_ENV === 'production' ? '' : '/admin/',
devServer: {
allowedHosts: ['localhost', '.gitpod.io'],
public: '127.0.0.1:8080',
proxy: {
'/': {
target: process.env.API_URL ? process.env.API_URL : 'https://demo.directus.io/',
changeOrigin: true
}
}
},
// There are so many chunks (from all the interfaces / layouts) that we need to make sure to not
// prefetch them all. Prefetching them all will cause the server to apply rate limits in most cases
chainWebpack: config => {
config.plugins.delete('prefetch');
if (process.env.NODE_ENV === 'development') {
config.output.filename('[name].[hash].js').end();
}
// NOTE: This should be removed when we have main.js refactored to TypeScript
config
.entry('app')
.clear()
.add('./src/main.js')
.end();
}
};