-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvue.config.js
49 lines (45 loc) · 1.82 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// const fs = require('fs')
const appConfig = require('./public/manifest')
process.env.VUE_APP_VERSION = require('./package.json').version
/** @type import('@vue/cli-service').ProjectOptions */
module.exports = {
runtimeCompiler: true,
productionSourceMap: false,
// https://github.com/neutrinojs/webpack-chain/tree/v4#getting-started
chainWebpack(config) {
// 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.
config.set('name', appConfig.title)
// Set up all the aliases we use in our app.
config.resolve.alias.clear().merge(require('./aliases.config').webpack)
// Don't allow importing .vue files without the extension, as
// it's necessary for some Vetur autocompletions.
config.resolve.extensions.delete('.vue')
// Only enable performance hints for production builds,
// outside of tests.
config.performance.hints(
process.env.NODE_ENV === 'production' &&
!process.env.VUE_APP_TEST &&
'warning'
)
},
css: {
// Enable CSS source maps. Disable for production build!
sourceMap: false,
loaderOptions: {
scss: {
prependData: `$ASSETS: '${process.env.VUE_APP_ASSETS_URL}'; @import "~@assets/css/mixins.scss"; @import "~@assets/css/variables.scss"; @import "~@assets/css/main.scss"; @import "~@assets/css/icons.scss"; @import "~@assets/css/typography.scss"; @import "~@assets/css/grid.scss"; @import "~@assets/css/vendors.scss"; @import "~@assets/css/print.scss";`,
},
},
},
// Configure Webpack's dev server.
// https://cli.vuejs.org/guide/cli-service.html
devServer: {
// https: {
// key: fs.readFileSync('./localhost.key'),
// cert: fs.readFileSync('./localhost.crt'),
// },
public: 'http://localhost:8083/',
},
publicPath: '/',
}