|
| 1 | +export default definePageConfig({ |
| 2 | + blocks: [ |
| 3 | + block.title('Vuestic Config'), |
| 4 | + |
| 5 | + block.paragraph('Vuestic config is a file that allows you to configure Vuestic UI components. You can customize the theme, layout, and other settings.'), |
| 6 | + block.paragraph('Compiler can automatically add Vuestic config to your project, but you need to manually create file `vuestic.config.ts` in the root of your project. You can find the example of the config file below.'), |
| 7 | + |
| 8 | + block.code({ |
| 9 | + 'vuestic.config.ts': ` |
| 10 | +import { defineVuesticConfig } from 'vuestic-ui' |
| 11 | +
|
| 12 | +export default defineVuesticConfig({ |
| 13 | + // Config here |
| 14 | +}) |
| 15 | + ` |
| 16 | + }), |
| 17 | + |
| 18 | + block.alert('It is new recommended way to configure Vuestic UI components', 'info'), |
| 19 | + |
| 20 | + block.subtitle('Installation'), |
| 21 | + |
| 22 | + block.code({ |
| 23 | + npm: 'npm install @vuestic/compiler@latest --save-dev', |
| 24 | + yarn: 'yarn add @vuestic/compiler@latest --dev' |
| 25 | + }, 'bash'), |
| 26 | + |
| 27 | + block.paragraph('Add `@vuestic/compiler` to your `vite.config.js` or `vite.config.ts` file and set `cssLayers` option to `true`:'), |
| 28 | + |
| 29 | + block.code({ |
| 30 | + 'vite.config.js': ` |
| 31 | +import { defineConfig } from 'vite' |
| 32 | +import vue from '@vitejs/plugin-vue' |
| 33 | +import { vuestic } from '@vuestic/compiler/vite' |
| 34 | +
|
| 35 | +export default defineConfig({ |
| 36 | + plugins: [ |
| 37 | + vuestic({ |
| 38 | + config: true, |
| 39 | + }), |
| 40 | + vue(), |
| 41 | + ], |
| 42 | +}) |
| 43 | +`, |
| 44 | + }), |
| 45 | + |
| 46 | + block.subtitle('Typescript and IDE suggestions'), |
| 47 | + |
| 48 | + block.paragraph('Vuestic compiler will generate typescript types, so you can get suggestions from your IDE for things like color names, i18n keys, icon names.'), |
| 49 | + |
| 50 | + block.paragraph('Make sure to include generated types to your tsconfig.json:'), |
| 51 | + |
| 52 | + block.code({ |
| 53 | + 'tsconfig.json': ` |
| 54 | +{ |
| 55 | + "include": ["node_modules/.vuestic/*.d.ts", "src/**/*"] |
| 56 | +} |
| 57 | + ` |
| 58 | + }), |
| 59 | + |
| 60 | + block.paragraph('In future versions, we can use the Vuestic config to generate code in compile time, that will reduce your bundle size and improve performance.'), |
| 61 | + ] |
| 62 | +}) |
0 commit comments