forked from bencodezen/vue-enterprise-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
35 lines (34 loc) · 1.07 KB
/
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
const appConfig = require('./src/app.config')
/** @type import('@vue/cli-service').ProjectOptions */
module.exports = {
configureWebpack: {
// We provide the app's title in Webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: appConfig.title,
// Set up all the aliases we use in our app.
resolve: {
alias: require('./aliases.config').webpack,
},
performance: {
// Only enable performance hints for production builds,
// outside of tests.
hints:
process.env.NODE_ENV === 'production' &&
!process.env.VUE_APP_TEST &&
'warning',
},
},
css: {
// Enable CSS source maps.
sourceMap: true,
},
// Configure Webpack's dev server.
// https://cli.vuejs.org/guide/cli-service.html
devServer: {
...(process.env.API_BASE_URL
? // Proxy API endpoints to the production base URL.
{ proxy: { '/api': { target: process.env.API_BASE_URL } } }
: // Proxy API endpoints a local mock API.
{ before: require('./tests/mock-api') }),
},
}