-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
35 lines (34 loc) · 1.16 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 { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const appConfig = require('./src/app.config')
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,
},
plugins: [
// Optionally produce a bundle analysis
// TODO: Remove once this feature is built into Vue CLI
new BundleAnalyzerPlugin({
analyzerMode: process.env.ANALYZE ? 'static' : 'disabled',
openAnalyzer: process.env.CI !== 'true',
}),
],
},
css: {
// Enable CSS source maps.
sourceMap: true,
},
// Configure Webpack's dev server.
// https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md
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') }),
},
}