Skip to content

Commit

Permalink
Merge pull request #364 from sronveaux/vuetify-treeshaking
Browse files Browse the repository at this point in the history
Enable Vuetify treeshaking
  • Loading branch information
fschmenger authored Mar 6, 2024
2 parents 680f40d + a4f4df1 commit ba60835
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 4 deletions.
194 changes: 193 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"sinon": "^17.0.1",
"sinon-chai": "^3.5.0",
"vue-cli-plugin-vuetify": "~2.5.8",
"vue-template-compiler": "2.7.14"
"vue-template-compiler": "2.7.14",
"vuetify-loader": "^1.9.2"
},
"engines": {
"node": ">= 16.19.0",
Expand Down
3 changes: 1 addition & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in vue.config.js with runtimeCompiler.
import Vue from 'vue';
import Vuetify from 'vuetify';
import Vuetify from 'vuetify/lib/framework';
import PortalVue from 'portal-vue'
import VueI18n from 'vue-i18n';
import 'roboto-fontface/css/roboto/roboto-fontface.css'
Expand All @@ -13,7 +13,6 @@ import UrlUtil from './util/Url';
import LocaleUtil from './util/Locale';
import ObjectUtil from './util/Object';
import ColorThemeUtil from './util/ColorTheme'
import 'vuetify/dist/vuetify.min.css';
import axios from 'axios';

Vue.use(Vuetify);
Expand Down
2 changes: 2 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ module.exports = defineConfig({
// Tweak configuration options for Karma test runner to produce a bundle
// which can run under Chrome headless. Avoid warnings due to custom entries
// and customized filenames. Enable correct code coverage of .vue files.
// Disable Vuetify treeshaking.
if (process.env.NODE_ENV === 'test') {
config.devtool = 'eval'
config.optimization.runtimeChunk = false
config.optimization.splitChunks = false
config.plugins = config.plugins.filter(plugin => plugin.constructor.name !== 'VuetifyLoaderPlugin')
delete config.target
delete config.entry
delete config.output.filename
Expand Down

0 comments on commit ba60835

Please sign in to comment.