storj/web/satellite/vite.config-vuetify.js
Vitalii e83e98e46a web/satellite: vuetify POC
Built side Vuetify subproject inside web/satellite with limited functinality.
For now it has navigation side bar, simple project dashboard and team page (where you can list/add team members).

Issue:
https://github.com/storj/storj/issues/5854

Change-Id: I9ff3e80b8ace1dc31de6a788174c5ffc19f050f8
2023-06-10 00:59:40 +00:00

86 lines
2.4 KiB
JavaScript

// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { visualizer } from 'rollup-plugin-visualizer';
import vue from '@vitejs/plugin-vue';
import viteCompression from 'vite-plugin-compression';
import vitePluginRequire from 'vite-plugin-require';
import svgLoader from 'vite-svg-loader';
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
const productionBrotliExtensions = ['js', 'css', 'ttf', 'woff', 'woff2'];
const plugins = [
vue({
template: { transformAssetUrls }
}),
svgLoader({
svgoConfig: {
plugins: [{ name: 'removeViewBox', fn: () => {} }],
},
}),
vitePluginRequire(),
vuetify({
autoImport: true,
styles: {
configFile: 'vuetify-poc/src/styles/settings.scss',
},
}),
];
if (process.env.NODE_ENV === 'production') {
plugins.push(viteCompression({
algorithm: 'brotliCompress',
threshold: 1024,
ext: '.br',
filter: new RegExp('\\.(' + productionBrotliExtensions.join('|') + ')$'),
}));
}
if (process.env['STORJ_DEBUG_BUNDLE_SIZE']) {
plugins.push(visualizer({
open: true,
brotliSize: true,
filename: 'analyse.html', // will be saved in project's root
}));
}
export default defineConfig(() => {
return {
base: '/static/dist_vuetify_poc',
plugins,
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@poc': resolve(__dirname, './vuetify-poc/src'),
'stream': 'stream-browserify',
'util': 'util/',
},
extensions: ['.js', '.ts', '.svg', '.vue', '.mjs'],
},
build: {
outDir: resolve(__dirname, 'dist_vuetify_poc'),
emptyOutDir: true,
rollupOptions: {
input: {
'vuetify-poc': resolve(__dirname, './index-vuetify.html'),
},
external: [
/satellite\/src\/views/,
/satellite\/src\/components/,
/satellite\/src\/router/,
],
},
},
optimizeDeps: {
exclude: ['* > vuetify/lib/components'],
},
define: {
'process.env': {},
},
};
});