first commit
This commit is contained in:
36
vite.config.js
Normal file
36
vite.config.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import { defineConfig } from "vite";
|
||||
import path from "path";
|
||||
import uni from "@dcloudio/vite-plugin-uni";
|
||||
import md5 from "md5-hash";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.join(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
api: "modern-compiler",
|
||||
silenceDeprecations: ["legacy-js-api"],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [uni()],
|
||||
build: {
|
||||
commonjsOptions: {
|
||||
transformMixedEsModules: true,
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
assetFileNames(d) {
|
||||
const baseName = d.name.replace(/\\/g, "/").split("/").pop();
|
||||
const newName = md5(baseName) + ".[hash].[extname]";
|
||||
return `assets/${newName}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user