|
|
@ -7,6 +7,9 @@ import path from "path"; |
|
|
|
import { handlebars } from "./plugins/handlebars"; |
|
|
|
import { handlebars } from "./plugins/handlebars"; |
|
|
|
import { loadEnv } from "vite"; |
|
|
|
import { loadEnv } from "vite"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import tailwind from "tailwindcss"; |
|
|
|
|
|
|
|
import rtl from "postcss-rtlcss"; |
|
|
|
|
|
|
|
|
|
|
|
export default defineConfig(({ mode }) => { |
|
|
|
export default defineConfig(({ mode }) => { |
|
|
|
const env = loadEnv(mode, process.cwd()); |
|
|
|
const env = loadEnv(mode, process.cwd()); |
|
|
|
return { |
|
|
|
return { |
|
|
@ -18,8 +21,8 @@ export default defineConfig(({ mode }) => { |
|
|
|
env.VITE_APP_DOMAIN + |
|
|
|
env.VITE_APP_DOMAIN + |
|
|
|
(env.VITE_NORMAL_ROUTER !== "true" ? "/#" : ""), |
|
|
|
(env.VITE_NORMAL_ROUTER !== "true" ? "/#" : ""), |
|
|
|
domain: env.VITE_APP_DOMAIN, |
|
|
|
domain: env.VITE_APP_DOMAIN, |
|
|
|
env |
|
|
|
env, |
|
|
|
} |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
react({ |
|
|
|
react({ |
|
|
|
babel: { |
|
|
|
babel: { |
|
|
@ -31,24 +34,24 @@ export default defineConfig(({ mode }) => { |
|
|
|
modules: false, |
|
|
|
modules: false, |
|
|
|
useBuiltIns: "entry", |
|
|
|
useBuiltIns: "entry", |
|
|
|
corejs: { |
|
|
|
corejs: { |
|
|
|
version: "3.29" |
|
|
|
version: "3.29", |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
] |
|
|
|
], |
|
|
|
] |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
VitePWA({ |
|
|
|
VitePWA({ |
|
|
|
disable: env.VITE_PWA_ENABLED !== "true", |
|
|
|
disable: env.VITE_PWA_ENABLED !== "true", |
|
|
|
registerType: "autoUpdate", |
|
|
|
registerType: "autoUpdate", |
|
|
|
workbox: { |
|
|
|
workbox: { |
|
|
|
maximumFileSizeToCacheInBytes: 4000000, // 4mb
|
|
|
|
maximumFileSizeToCacheInBytes: 4000000, // 4mb
|
|
|
|
globIgnores: ["**ping.txt**"] |
|
|
|
globIgnores: ["**ping.txt**"], |
|
|
|
}, |
|
|
|
}, |
|
|
|
includeAssets: [ |
|
|
|
includeAssets: [ |
|
|
|
"favicon.ico", |
|
|
|
"favicon.ico", |
|
|
|
"apple-touch-icon.png", |
|
|
|
"apple-touch-icon.png", |
|
|
|
"safari-pinned-tab.svg" |
|
|
|
"safari-pinned-tab.svg", |
|
|
|
], |
|
|
|
], |
|
|
|
manifest: { |
|
|
|
manifest: { |
|
|
|
name: "movie-web", |
|
|
|
name: "movie-web", |
|
|
@ -63,48 +66,53 @@ export default defineConfig(({ mode }) => { |
|
|
|
src: "android-chrome-192x192.png", |
|
|
|
src: "android-chrome-192x192.png", |
|
|
|
sizes: "192x192", |
|
|
|
sizes: "192x192", |
|
|
|
type: "image/png", |
|
|
|
type: "image/png", |
|
|
|
purpose: "any" |
|
|
|
purpose: "any", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
src: "android-chrome-512x512.png", |
|
|
|
src: "android-chrome-512x512.png", |
|
|
|
sizes: "512x512", |
|
|
|
sizes: "512x512", |
|
|
|
type: "image/png", |
|
|
|
type: "image/png", |
|
|
|
purpose: "any" |
|
|
|
purpose: "any", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
src: "android-chrome-192x192.png", |
|
|
|
src: "android-chrome-192x192.png", |
|
|
|
sizes: "192x192", |
|
|
|
sizes: "192x192", |
|
|
|
type: "image/png", |
|
|
|
type: "image/png", |
|
|
|
purpose: "maskable" |
|
|
|
purpose: "maskable", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
src: "android-chrome-512x512.png", |
|
|
|
src: "android-chrome-512x512.png", |
|
|
|
sizes: "512x512", |
|
|
|
sizes: "512x512", |
|
|
|
type: "image/png", |
|
|
|
type: "image/png", |
|
|
|
purpose: "maskable" |
|
|
|
purpose: "maskable", |
|
|
|
} |
|
|
|
}, |
|
|
|
] |
|
|
|
], |
|
|
|
} |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
loadVersion(), |
|
|
|
loadVersion(), |
|
|
|
checker({ |
|
|
|
checker({ |
|
|
|
overlay: { |
|
|
|
overlay: { |
|
|
|
position: "tr" |
|
|
|
position: "tr", |
|
|
|
}, |
|
|
|
}, |
|
|
|
typescript: true, // check typescript build errors in dev server
|
|
|
|
typescript: true, // check typescript build errors in dev server
|
|
|
|
eslint: { |
|
|
|
eslint: { |
|
|
|
// check lint errors in dev server
|
|
|
|
// check lint errors in dev server
|
|
|
|
lintCommand: "eslint --ext .tsx,.ts src", |
|
|
|
lintCommand: "eslint --ext .tsx,.ts src", |
|
|
|
dev: { |
|
|
|
dev: { |
|
|
|
logLevel: ["error"] |
|
|
|
logLevel: ["error"], |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |
|
|
|
}), |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
build: { |
|
|
|
build: { |
|
|
|
sourcemap: true, |
|
|
|
sourcemap: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
css: { |
|
|
|
|
|
|
|
postcss: { |
|
|
|
|
|
|
|
plugins: [tailwind(), rtl()], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resolve: { |
|
|
|
resolve: { |
|
|
|
alias: { |
|
|
|
alias: { |
|
|
@ -112,12 +120,12 @@ export default defineConfig(({ mode }) => { |
|
|
|
"@sozialhelden/ietf-language-tags": path.resolve( |
|
|
|
"@sozialhelden/ietf-language-tags": path.resolve( |
|
|
|
__dirname, |
|
|
|
__dirname, |
|
|
|
"./node_modules/@sozialhelden/ietf-language-tags/dist/cjs" |
|
|
|
"./node_modules/@sozialhelden/ietf-language-tags/dist/cjs" |
|
|
|
) |
|
|
|
), |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
test: { |
|
|
|
test: { |
|
|
|
environment: "jsdom" |
|
|
|
environment: "jsdom", |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}); |
|
|
|
}); |
|
|
|