deploy: auto commit repo-root changes 2026-07-13 22:38:58
This commit is contained in:
+42
-30
@@ -1,4 +1,4 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import uni from '@dcloudio/vite-plugin-uni'
|
||||
import tailwindcss from 'tailwindcss'
|
||||
import autoprefixer from 'autoprefixer'
|
||||
@@ -28,37 +28,49 @@ const suppressUniRouterSourcemapWarning = (msg: string) =>
|
||||
msg.includes("didn't generate a sourcemap")
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
||||
customLogger: {
|
||||
info(msg) { console.log(msg) },
|
||||
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
error(msg) { console.error(msg) },
|
||||
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
infoOnce(msg) { console.log(msg) },
|
||||
clearScreen() { },
|
||||
hasWarned: false,
|
||||
hasErrorLogged: false,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
if (
|
||||
warning.message?.includes('plugin (unplugin-uni-router) was used to transform files') &&
|
||||
warning.message?.includes("didn't generate a sourcemap")
|
||||
) {
|
||||
return
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
return {
|
||||
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
||||
customLogger: {
|
||||
info(msg) { console.log(msg) },
|
||||
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
error(msg) { console.error(msg) },
|
||||
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
infoOnce(msg) { console.log(msg) },
|
||||
clearScreen() { },
|
||||
hasWarned: false,
|
||||
hasErrorLogged: false,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
if (
|
||||
warning.message?.includes('plugin (unplugin-uni-router) was used to transform files') &&
|
||||
warning.message?.includes("didn't generate a sourcemap")
|
||||
) {
|
||||
return
|
||||
}
|
||||
warn(warning)
|
||||
}
|
||||
warn(warning)
|
||||
}
|
||||
},
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: postcssPlugin
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 5177,
|
||||
proxy: isH5 && env.VITE_APP_BASE_URL
|
||||
? {
|
||||
'/api': {
|
||||
target: env.VITE_APP_BASE_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
}
|
||||
},
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: postcssPlugin
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 5177
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user