diff options
| author | 2024-09-10 04:37:15 +0800 | |
|---|---|---|
| committer | 2024-09-10 04:37:15 +0800 | |
| commit | dc47286c90c8cd94813fcb82532679678494638b (patch) | |
| tree | 74a2ece2ae468927e315ef35c341efe922e965d2 /farm.config.ts | |
| parent | 9ec3a2965c0e25f230b397a01c3c8b0543e61956 (diff) | |
| download | HydroRollSite-dc47286c90c8cd94813fcb82532679678494638b.tar.gz HydroRollSite-dc47286c90c8cd94813fcb82532679678494638b.zip | |
refactor: migrate vite to farm
Diffstat (limited to 'farm.config.ts')
| -rw-r--r-- | farm.config.ts | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/farm.config.ts b/farm.config.ts new file mode 100644 index 0000000..454aefe --- /dev/null +++ b/farm.config.ts @@ -0,0 +1,52 @@ +import vue from '@vitejs/plugin-vue' +import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' +import ViteFonts from 'unplugin-fonts/vite' + +import { defineConfig } from '@farmfe/core' +import { fileURLToPath, URL } from 'node:url' + +export default defineConfig({ + vitePlugins: [ + vue({ + template: { transformAssetUrls } + }), + vuetify({ + autoImport: true, + styles: { + configFile: 'src/styles/settings.scss', + }, + }), + ViteFonts({ + google: { + families: [{ + name: 'Roboto', + styles: 'wght@100;300;400;500;700;900', + }], + }, + }), + ], + compilation: { + // lazyCompilation: false, + // persistentCache: true, + // minify: true, + // treeShaking: true, + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + }, + extensions: [ + '.js', + '.json', + '.jsx', + '.mjs', + '.ts', + '.tsx', + '.vue', + ], + }, + }, + server: { + port: 3000, + }, +}) + |
