-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.build.css.ts
52 lines (49 loc) · 1.42 KB
/
vite.config.build.css.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'vite'
const path = require('path')
const atImport = require('postcss-import')
const config = require('./package.json')
const banner = `/*!
* ${config.name} v${config.version} ${new Date()}
* (c) 2023 @BlazorMix
* Released under the MIT License.
*/`
const { resolve } = path
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: [{ find: '@', replacement: resolve(__dirname, './src/BlazorMix/wwwroot/src/scss') }],
},
css: {
preprocessorOptions: {
scss: {
charset: false,
additionalData: `@import "@/styles/variables.scss";`,
},
postcss: {
plugins: [atImport({ path: path.join(__dirname, 'src`') })],
},
},
},
plugins: [],
build: {
emptyOutDir: false,
outDir: './src/BlazorMix/wwwroot/dist',
rollupOptions: {
output: {
banner,
assetFileNames: (fileInfo) => {
// if (fileInfo.name == 'style.css'){
// return 'index.min.css';
// }
return `[name].[ext]`
},
},
},
lib: {
entry: './src/BlazorMix/wwwroot/src/scss/styles/themes/default.scss',
formats: ['es'],
name: 'index',
fileName: 'index',
},
},
})