forked from openwebwork/webwork3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
quasar.conf.js
115 lines (102 loc) · 2.4 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
/* 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: [
'axios',
'i18n',
'logger'
],
css: [
'app.scss'
],
extras: [
'roboto-font',
'material-icons'
],
framework: {
plugins: [
'Notify'
],
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.*/;
});
}
cfg.module.rules.push ({
test: /\.m?js/,
resolve: {
fullySpecified: false,
fallback: {
crypto: false,
fs: false
}
}
});
}
},
devServer: {
https: false,
port: 8080,
open: true, // 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/, '')
}]
}
}
};
});