forked from ActivityWatch/aw-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
61 lines (60 loc) · 1.6 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
50
51
52
53
54
55
56
57
58
59
60
61
const path = require('path');
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const { argv } = require('yargs');
module.exports = {
pages: {
index: {
entry: './src/main.js',
template: './src/index.html',
},
},
chainWebpack: config => {
config.plugin('define').tap(options => {
options[0]['process.env'].VUE_APP_ON_ANDROID = argv.os == 'android';
return options;
});
},
configureWebpack: {
// sourcemaps are not enabled when `--watch` is used https://github.com/vuejs/vue-cli/issues/1806#issuecomment-832111894
devtool: 'source-map',
resolve: {
alias: {
'~': path.resolve(__dirname, './src'),
src: path.resolve(__dirname, './src'),
assets: path.resolve(__dirname, './src/assets'),
components: path.resolve(__dirname, './src/components'),
},
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin({
AW_SERVER_URL: process.env.AW_SERVER_URL,
PRODUCTION: process.env.NODE_ENV === 'production',
}),
new CopyWebpackPlugin([{ from: 'static/', to: 'static' }]),
],
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 27180,
},
pwa: {
name: 'ActivityWatch',
iconPaths: {
favicon32: 'static/logo.png',
favicon16: 'static/logo.png',
},
},
pluginOptions: {
webpackBundleAnalyzer: {
openAnalyzer: false,
analyzerPort: 11000,
},
},
transpileDependencies: [
// can be string or regex
'vis-data',
],
};