-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
46 lines (41 loc) · 1001 Bytes
/
vite.config.js
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
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import markdownify from 'vite-plugin-markdownify';
const env_vars = loadEnv('', process.cwd())
const cssPlugin = () => {
return {
name: 'css-transform',
transform(src, id) {
if (/\.(scss)$/.test(id) || /\.(txt)$/.test(id)) {
return src.replace(/%([a-zA-Z_]*?)%/g, (match, p1) => env_vars[p1]);
}
}
}
};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
cssPlugin(),
markdownify({
htmlTemplate: './dist/index.html',
input: './markdown',
output: './dist/',
words_per_minute: 275,
defaults: {
title: env_vars.VITE_TITLE,
author: env_vars.VITE_AUTHOR,
description: env_vars.VITE_DESCRIPTION,
baseUrl: env_vars.VITE_URL,
"og:type": `article`
}
})
],
css: {
preprocessorOptions: {
scss: {
// your stylus options here
}
},
},
})