Skip to content

Commit

Permalink
refactor: dead code removed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Jun 17, 2024
1 parent 833892d commit 2170b71
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 58 deletions.
1 change: 0 additions & 1 deletion src/plugins/vuetify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default createVuetify({
},

theme: {
cspNonce: document.querySelector<HTMLMetaElement>('meta[property=csp-nonce]')?.nonce,
themes: {
light: {
colors: {
Expand Down
2 changes: 0 additions & 2 deletions src/vanillaTS/globalConst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@ export const months: Readonly<Array<string>> = [
'December',
];

export const nonce: Readonly<string> ='f73ba6133da5dc5d985b5ab9388e2beef532f43cff754fffce7e57b2046cc22ed8542f6f29408e7c';

export const token_regex = /^[0-9]{6}$|^[a-fA-F0-9]{16}$/;
102 changes: 47 additions & 55 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';

// Utilities
import { defineConfig, loadEnv } from 'vite';
import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'node:url';

const pwaOptions: Partial<VitePWAOptions> = {
Expand Down Expand Up @@ -51,61 +51,53 @@ const pwaOptions: Partial<VitePWAOptions> = {
};

// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
export default defineConfig({

const env = loadEnv(mode, process.cwd());

return {

plugins: [
vue({
template: { transformAssetUrls }
}),
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
vuetify({
autoImport: true,
}),
Components(),
AutoImport({
include: [
/\.[tj]sx?$/,
/\.vue$/, /\.vue\?vue/,
/\.md$/,
],
imports: [
'vue',
'vue-router',
],
dts: 'src/auto-imports.d.ts',
eslintrc: {
enabled: true,
},
dirs: [
'src/store',
],
vueTemplate: false,
}),
VitePWA(pwaOptions),
viteCompression({ algorithm: 'brotliCompress', filter: /\.(js|mjs|json|css)$/i }),
viteCompression({ algorithm: 'gzip', filter: /\.(js|mjs|json|css)$/i }),
],
define: {
'process.env': {},
'import.meta.env.BUILD_DATE': Date.now(),
'import.meta.env.VERSION': JSON.stringify(process.env.npm_package_version),
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
plugins: [
vue({
template: { transformAssetUrls }
}),
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
vuetify({
autoImport: true,
}),
Components(),
AutoImport({
include: [
/\.[tj]sx?$/,
/\.vue$/, /\.vue\?vue/,
/\.md$/,
],
imports: [
'vue',
'vue-router',
],
dts: 'src/auto-imports.d.ts',
eslintrc: {
enabled: true,
},
extensions: [ '.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue' ],
},
html: {
cspNonce: env.VITE_CSP_NONCE,
},
server: {
port: 8002,
host: '127.0.0.1'
dirs: [
'src/store',
],
vueTemplate: false,
}),
VitePWA(pwaOptions),
viteCompression({ algorithm: 'brotliCompress' }),
viteCompression({ algorithm: 'gzip' }),
],
define: {
'process.env': {},
'import.meta.env.BUILD_DATE': Date.now(),
'import.meta.env.VERSION': JSON.stringify(process.env.npm_package_version),
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
};
extensions: [ '.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue' ],
},
server: {
port: 8002,
host: '127.0.0.1'
},
});

0 comments on commit 2170b71

Please sign in to comment.