Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit dab22f6

Browse files
committed
fix: dependency pruning was a bit too inclusive
1 parent 7cf2dbc commit dab22f6

File tree

1 file changed

+31
-21
lines changed

1 file changed

+31
-21
lines changed

quasar.config.js

+31-21
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,7 @@ module.exports = configure(function (/* ctx */) {
3030

3131
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
3232
build: {
33-
// chainWebpack(chain) {
34-
// const nodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin');
35-
// chain.plugin('node-polyfill').use(nodePolyfillWebpackPlugin);
36-
// },
3733
extendViteConf(viteConf) {
38-
// if (!viteConf.optimizeDeps) viteConf.optimizeDeps = {};
39-
// if (!viteConf.optimizeDeps.exclude) viteConf.optimizeDeps.exclude = [
40-
// 'pdfjs-dist',
41-
// ];
4234
viteConf.optimizeDeps = mergeConfig(viteConf, {
4335
esbuildOptions: {
4436
define: {
@@ -90,7 +82,6 @@ module.exports = configure(function (/* ctx */) {
9082
vueRouterMode: 'hash', // available values: 'hash', 'history'
9183
},
9284

93-
// animations: 'all', // --- includes all animations
9485
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
9586
css: ['app.scss', 'mmm-icons.css'],
9687

@@ -117,11 +108,6 @@ module.exports = configure(function (/* ctx */) {
117108
appId: 'sircharlo.meeting-media-manager',
118109
// eslint-disable-next-line no-template-curly-in-string
119110
artifactName: 'meeting-media-manager-${version}.${ext}',
120-
// buildDependenciesFromSource: true,
121-
// files: [
122-
// '!node_modules/better-sqlite3/build/Release/*.node',
123-
// '!node_modules/canvas/build/Release/*.node',
124-
// ],
125111
generateUpdatesFilesForAllChannels: true,
126112
linux: {
127113
category: 'Utility',
@@ -192,9 +178,12 @@ module.exports = configure(function (/* ctx */) {
192178
}
193179
},
194180
extendPackageJson(pkg) {
195-
const electronDeps = [
181+
const requiredNonUiElectronDependencies = [
196182
'@electron/remote',
183+
'@quasar/extras',
184+
'@sentry/vue',
197185
'adm-zip',
186+
'axios',
198187
'better-sqlite3',
199188
'electron-updater',
200189
'electron-window-state',
@@ -203,22 +192,43 @@ module.exports = configure(function (/* ctx */) {
203192
'klaw-sync',
204193
'music-metadata',
205194
'pdfjs-dist',
195+
'pinia',
196+
'pinia-shared-state',
206197
'quasar',
198+
'sanitize-filename',
199+
'sanitize-html',
207200
'upath',
201+
'vue',
202+
'vue-i18n',
203+
'vue-router',
208204
];
209205

210-
// Remove UI dependencies from production build
206+
// Remove unneeded dependencies from production build
211207
Object.keys(pkg.dependencies).forEach((dep) => {
212-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
213-
if (!electronDeps.includes(dep)) delete pkg.dependencies[dep];
208+
if (!requiredNonUiElectronDependencies.includes(dep)) {
209+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
210+
delete pkg.dependencies[dep];
211+
}
214212
});
213+
214+
/* As of 2024-10-15, this logic results in the following dependencies being removed:
215+
{
216+
'@formkit/drag-and-drop',
217+
'@panzoom/panzoom',
218+
'@quasar/cli',
219+
'dompurify',
220+
'is-online',
221+
'obs-websocket-js',
222+
'p-queue',
223+
'pretty-bytes',
224+
}
225+
226+
Anything more than this led to errors in the built Electron app.
227+
*/
215228
},
216229
inspectPort: 5858,
217230
},
218231

219-
// https://github.com/quasarframework/quasar/tree/dev/extras
220-
// extras: ['fontawesome-v6', 'material-icons', 'mdi-v7'],
221-
222232
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
223233
framework: {
224234
config: {

0 commit comments

Comments
 (0)