Files
Nexior/vite.config.ts
T
2021-09-21 00:59:44 +08:00

42 lines
924 B
TypeScript

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import replace from '@rollup/plugin-replace';
import pkg from './package.json';
import { string } from 'rollup-plugin-string';
import path from 'path';
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true
},
'/ws': {
target: 'ws://localhost:8000',
changeOrigin: true,
ws: 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
}
});