-
Notifications
You must be signed in to change notification settings - Fork 8
/
quasar.conf.js
134 lines (119 loc) · 2.98 KB
/
quasar.conf.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* eslint-env node */
const { configure } = require('quasar/wrappers');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const path = require('path');
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = configure(function (ctx) {
return {
supportTS: {
tsCheckerConfig: {
eslint: {
enabled: true,
files: './src/**/*.{ts,tsx,js,jsx,vue}'
}
}
},
boot: [
'pinia',
'axios',
'i18n',
'logger'
],
css: [
'app.scss'
],
extras: [
'roboto-font',
'material-icons'
],
framework: {
plugins: [
'Notify',
'Dialog'
],
config: {
notify: { /* look at QuasarConfOptions from the API card */ }
}
},
build: {
vueRouterMode: 'history',
publicPath: '/webwork3',
chainWebpack(chain) {
chain.plugin('stylelint-webpack').use(new StyleLintPlugin({
emitError: ctx.prod ? true : false,
extensions: ['vue', 'html', 'css', 'scss', 'sass'],
files: ['**/*.{vue,html,css,scss,sass}'],
exclude: ['node_modules', 'dist']
}));
chain.plugin('nodePolyfills').use(NodePolyfillPlugin);
if (ctx.prod) {
chain.plugin('copy-webpack')
.tap(args => {
args[0].patterns.push({
from: path.resolve(__dirname, './node_modules/mathjax/es5'),
to: path.resolve(__dirname, './dist/spa/mathjax'),
toType: 'dir'
});
return args;
});
}
},
extendWebpack(cfg) {
if (cfg.optimization && cfg.optimization.minimizer instanceof Array) {
cfg.optimization.minimizer.forEach((plugin) => {
if (plugin.constructor.name == 'TerserPlugin')
plugin.options.exclude = /.*mathjax.*/;
});
}
if (cfg.optimization && cfg.optimization.splitChunks) {
cfg.optimization.splitChunks.cacheGroups.defaultVendors = {
test: /[\\/]node_modules[\\/]/,
name(module) { return module.identifier().split('/').reduceRight((item) => item); },
chunks: 'all',
reuseExistingChunk: true
};
}
cfg.module.rules.push ({
test: /\.m?js/,
resolve: {
fullySpecified: false,
fallback: {
crypto: false,
fs: false
}
}
});
// For i18n resources (json/json5/yaml)
cfg.module.rules.push({
test: /\.(json5?|ya?ml)$/,
type: 'javascript/auto',
include: [ path.resolve(__dirname, './src/locales') ],
loader: '@intlify/vue-i18n-loader'
});
}
},
devServer: {
https: false,
port: 8080,
open: false, // opens browser window automatically,
proxy: {
'/webwork3/api': 'http://localhost:3000',
'/renderer': 'http://localhost:3001',
'/opl': {
target: 'http://localhost:3030',
changeOrigin: true,
pathRewrite: {
'^/opl': ''
}
}
},
static: path.join(__dirname, 'node_modules/mathjax/es5'),
historyApiFallback: {
rewrites: [{
from: /^\/webwork3\/mathjax\/.*$/,
to: (context) => context.parsedUrl.pathname.replace(/^\/webwork3\/mathjax/, '')
}]
}
}
};
});