Skip to content

Commit

Permalink
fix(vite): don't load roboto from google fonts
Browse files Browse the repository at this point in the history
Closes #21

Signed-off-by: Lukas Mertens <git@lukas-mertens.de>

commit-id:2abe004b
  • Loading branch information
lukas-mertens committed Mar 13, 2024
1 parent 2c4d181 commit 4397618
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 101 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"type": "module",
"dependencies": {
"@fontsource/roboto": "5.0.12",
"@json-layout/core": "^0.9.3",
"@json-layout/vocabulary": "^0.9.1",
"@koumoul/vjsf": "^3.0.0-beta.3",
Expand All @@ -28,8 +29,6 @@
"markdown-it": "^14.0.0",
"pinia": "^2.1.7",
"register-service-worker": "^1.7.2",
"roboto-fontface": "*",
"unplugin-fonts": "^1.1.1",
"vue": "^3.4.19",
"vue-class-component": "^7.2.6",
"vue-property-decorator": "^9.1.2",
Expand Down
81 changes: 17 additions & 64 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright 2020 - 2022 Pionix GmbH and Contributors to EVerest

import "@mdi/font/css/materialdesignicons.css";
import "@fontsource/roboto/index.css";
import Vue from "vue";
import {createApp} from "vue";
import "./registerServiceWorker";
Expand Down
59 changes: 24 additions & 35 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Vue from '@vitejs/plugin-vue';
import Vuetify, {transformAssetUrls} from 'vite-plugin-vuetify';
import {defineConfig, loadEnv} from "vite";
import ViteFonts from 'unplugin-fonts/vite';
import {commonjsDeps} from '@koumoul/vjsf/utils/build';
import {fileURLToPath} from "node:url";
import commonjs from "@rollup/plugin-commonjs";
Expand All @@ -10,40 +9,30 @@ export default defineConfig(({ mode}) => {
loadEnv(mode, process.cwd(), '');
return {
base: mode === 'pages' ? `/everest-admin-panel/${process.env.SUBDIR}` : '',
optimizeDeps: {
optimizeDeps: {
include: commonjsDeps,
},
build: {
commonjsOptions: {
include: commonjsDeps,
}
},
plugins: [
commonjs(),
Vue({
template: { transformAssetUrls }
}),
Vuetify({
autoImport: true,
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
build: {
commonjsOptions: {
include: commonjsDeps,
}
},
plugins: [
commonjs(),
Vue({
template: { transformAssetUrls }
}),
Vuetify({
autoImport: true,
}),
ViteFonts({
google: {
families: [ {
name: 'Roboto',
styles: 'wght@100;300;400;500;700;900',
}],
},
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
},
server: {
port: 8080,
},

}
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json'],
},
server: {
port: 8080,
},}
});

0 comments on commit 4397618

Please sign in to comment.