|
@@ -2,6 +2,7 @@ import { defineConfig,loadEnv } from 'vite'
|
|
|
import path from 'path'
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
import requireTransform from 'vite-plugin-require-transform';
|
|
|
+import commonjs from '@rollup/plugin-commonjs';
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
export default defineConfig(configEnv =>{
|
|
@@ -12,8 +13,9 @@ export default defineConfig(configEnv =>{
|
|
|
|
|
|
plugins: [
|
|
|
vue(),
|
|
|
+ commonjs(),
|
|
|
requireTransform({
|
|
|
- fileRegex: /.js$|.vue$/
|
|
|
+ fileRegex: /.js$|.vue$|.png$/
|
|
|
}),
|
|
|
],
|
|
|
|
|
@@ -50,7 +52,7 @@ export default defineConfig(configEnv =>{
|
|
|
output: {
|
|
|
chunkFileNames: "static/js/[name][hash].js",
|
|
|
entryFileNames: "static/js/[name][hash].js",
|
|
|
- assetFileNames: "static/[ext]/[name][hash].[ext]"
|
|
|
+ assetFileNames: "static/assets/[ext]/[name][hash].[ext]"
|
|
|
}
|
|
|
}
|
|
|
}
|