Skip to content

Commit f7a7683

Browse files
authored
chore(unify): optimize deps automatically, clean up unused files (#18429)
1 parent d331d24 commit f7a7683

File tree

10 files changed

+82
-262
lines changed

10 files changed

+82
-262
lines changed

packages/app/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,16 @@
7272
"dist",
7373
"lib",
7474
"src"
75-
]
75+
],
76+
"vite": {
77+
"optimizeDeps": {
78+
"include": [
79+
"@urql/vue",
80+
"@vueuse/core",
81+
"lodash",
82+
"vue",
83+
"vue-toast-notification"
84+
]
85+
}
86+
}
7687
}

packages/app/src/Foo.spec.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/app/src/Foo.vue

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/app/src/components/button/Button.vue

Lines changed: 0 additions & 90 deletions
This file was deleted.

packages/app/src/components/input/Input.vue

Lines changed: 0 additions & 106 deletions
This file was deleted.

packages/app/src/composables/index.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/app/src/layouts/default.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
2-
<div class="h-screen overflow-hidden flex flex-row bg-red">
3-
<main class="min-w-0 flex-1 border-t bg-green border-gray-200 lg:flex">
2+
<div class="h-screen overflow-hidden flex flex-row">
3+
<main class="min-w-0 flex-1 border-t border-gray-200 lg:flex">
44
<section
55
aria-labelledby="primary-heading"
66
class="min-w-0 flex-1 h-full flex flex-col overflow-hidden lg:order-last"

packages/frontend-shared/vite.config.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import Components from 'unplugin-vue-components/vite'
99
import Icons from 'unplugin-icons/vite'
1010
import IconsResolver from 'unplugin-icons/resolver'
1111
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
12+
import OptimizationPersist from 'vite-plugin-optimize-persist'
13+
import PkgConfig from 'vite-plugin-package-config'
1214

1315
// eslint-disable-next-line no-duplicate-imports
1416
import type { UserConfig } from 'vite'
@@ -35,29 +37,37 @@ const alias = {
3537
const makePlugins = (plugins) => {
3638
return ([
3739
vue(),
38-
vueJsx(),
40+
vueJsx(), // Used mostly for testing in *.(t|j)sx files.
3941
VueI18n({
4042
include: path.resolve(__dirname, './src/locales/**'),
4143
...plugins.vueI18nOptions,
4244
}),
4345
Icons({
46+
// 1em. Default, without this options is 1.2em.
47+
// If you notice that your icons are bigger than they should be, this
48+
// is probably why.
4449
scale: 1,
4550
customCollections: {
46-
// ~icons/cy/book-x16
51+
// ~icons/cy/book_x16
4752
cy: FileSystemIconLoader(path.resolve(__dirname, './src/assets/icons')),
4853
...plugins.iconsOptions?.customCollections,
4954
},
5055
...plugins.iconsOptions,
5156
}),
5257
Components({
53-
// <i-cy-book-x16/>
5458
resolvers: IconsResolver({
59+
// <i-cy-book_x16/>
5560
customCollections: ['cy'],
5661
}),
5762
...plugins?.componentsOptions,
5863
}),
5964
WindiCSS(),
6065
VueSvgLoader(),
66+
67+
// package.json is modified and auto-updated when new cjs dependencies
68+
// are added
69+
PkgConfig(),
70+
OptimizationPersist(),
6171
// For new plugins only! Merge options for shared plugins via PluginOptions.
6272
...(plugins?.plugins || []),
6373
])

packages/launchpad/package.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
"vite": "2.4.4",
5252
"vite-plugin-components": "0.11.3",
5353
"vite-plugin-icons": "0.6.3",
54+
"vite-plugin-optimize-persist": "0.0.5",
55+
"vite-plugin-package-config": "0.0.3",
5456
"vite-plugin-purge-icons": "0.7.0",
5557
"vite-plugin-windicss": "1.2.4",
5658
"vite-svg-loader": "2.1.1",
@@ -69,5 +71,42 @@
6971
"lib",
7072
"script",
7173
"src"
72-
]
74+
],
75+
"vite": {
76+
"optimizeDeps": {
77+
"include": [
78+
"@headlessui/vue",
79+
"@iconify/iconify",
80+
"@iconify/vue",
81+
"@purge-icons/generated",
82+
"@testing-library/cypress/add-commands",
83+
"@urql/core",
84+
"@urql/devtools",
85+
"@urql/exchange-execute",
86+
"@urql/exchange-graphcache",
87+
"@urql/vue",
88+
"@vue/test-utils",
89+
"@vueuse/core",
90+
"cypress-file-upload",
91+
"dedent",
92+
"fake-uuid",
93+
"graphql",
94+
"graphql-relay",
95+
"graphql/jsutils/Path",
96+
"lodash",
97+
"path",
98+
"prismjs",
99+
"prismjs/components/prism-typescript",
100+
"prismjs/components/prism-yaml",
101+
"vue",
102+
"vue-demi",
103+
"vue-i18n",
104+
"vue-prism-component",
105+
"vue-prism-editor",
106+
"vue-toast-notification",
107+
"vue3-file-selector",
108+
"wonka"
109+
]
110+
}
111+
}
73112
}

0 commit comments

Comments
 (0)