1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import { resolve } from 'path'
- import { defineConfig } from 'vite'
- import vue2 from '@vitejs/plugin-vue2'
- export default ({ mode }) => {
- return defineConfig({
- base: mode === 'production' ? '/' : '/',
- plugins: [
- vue2(),
-
-
-
-
- ],
- resolve: {
- alias: {
- '@': resolve(__dirname, 'src'),
- },
-
- extensions: [
- '.mjs',
- '.js',
- '.mts',
- '.ts',
- '.jsx',
- '.tsx',
- '.json',
- '.vue',
- ],
- },
- css: {
- devSourcemap: true,
- preprocessorOptions: {
- scss: {
- additionalData: `@import "/src/styles/variables.scss";`,
- },
- },
- },
- server: {
-
- https: false,
-
- port: 9876,
-
- host: '0.0.0.0',
-
-
-
- cors: true,
-
- proxy: {
- '/api': {
- target: 'http://13.55.42.195:10171',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ''),
- },
- },
- },
- build: {
-
- target: 'es2020',
-
- sourcemap: mode !== 'production',
-
- cssCodeSplit: false,
-
- chunkSizeWarningLimit: 1000,
-
- reportCompressedSize: mode !== 'production',
- rollupOptions: {
- output: {
- manualChunks: {
- element: ['element-ui']
- },
- },
- },
- },
- })
- }
|