-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.utils.js
34 lines (30 loc) · 967 Bytes
/
app.utils.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const getLocaleLangs = () => {
const glob = require('glob')
const path = require('path')
const localeLangsPath = path.resolve('./src/shared/ui/locales/*.json')
return glob.sync(localeLangsPath).map(file => {
const pathParts = file.split('/')
const localeLang = pathParts.at(-1).split('.')[0]
return localeLang
}).reverse()
}
const generateIOSSplashScreens = () => {
const path = require('path')
const pwaAssetGenerator = require('pwa-asset-generator')
const appConfig = require('./app.config')
pwaAssetGenerator.generateImages(
path.resolve('./src/shared/ui/icons/manifest/maskable.svg'),
path.resolve('./src/shared/ui/icons/manifest/splash'),
{
// index: path.resolve('./src/app.html'),
background: appConfig.APP_DEFAULT_THEME_COLOR,
padding: `calc(50vh - 48px) calc(50vw - 48px)`,
splashOnly: true,
type: 'png'
}
)
}
module.exports = {
getLocaleLangs,
generateIOSSplashScreens
}