| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import { defineConfig } from "vite"
- import react from "@vitejs/plugin-react"
- import svgr from "vite-plugin-svgr"
- import { name } from "./package.json"
- const genBaseUrl = (mode) => {
- if (mode !== "development") {
- if (mode == "test") {
- return `/${name}-test/`
- }
- return `/${name}/`
- }
- return "/"
- }
- export default defineConfig(({ mode }) => {
- return {
- resolve: {
- alias: {
- "@": "/src",
- "@/packages/stt-sdk-core": "/packages/stt-sdk-core/src",
- },
- },
- base: genBaseUrl(mode),
- build: {
- // cssCodeSplit: false,
- // target: "es2015",
- },
- server: {
- host: "0.0.0.0",
- allowedHosts: true,
- port: 8080,
- watch: {
- // usePolling: true
- },
- },
- plugins: [
- react(),
- svgr({
- svgrOptions: {
- // icon: true,
- // typescript: true,
- },
- }),
- ],
- css: {
- preprocessorOptions: {
- scss: {
- api: "modern",
- },
- },
- modules: {
- // hashPrefix: 'hash',
- // generateScopedName: "[name]__[local]__[hash:base64:2]",
- // globalModulePaths: [
- // /.*\\.global\\..*/
- // ]
- },
- postcss: {
- plugins: [],
- },
- },
- }
- })
|