Files
Nexior/vite.config.ts
T
2021-08-28 02:20:05 +08:00

37 lines
816 B
TypeScript

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from 'path';
import replace from '@rollup/plugin-replace';
import pkg from './package.json';
import { string } from 'rollup-plugin-string';
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true
}
}
},
plugins: [
vue(),
string({
include: ['**/*.md', '**/*.theme', 'highlight.js/styles/*.css']
}),
replace({
preventAssignment: true,
VDITOR_VERSION: JSON.stringify(pkg.dependencies.vditor.replace(/^[\^\~]/g, '')),
'_VDITOR_VERSION as VDITOR_VERSION': ''
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
build: {
sourcemap: true
}
});