1.0.24 • Published 9 months ago
vite-plugin-balafon v1.0.24
balafon-vite-plugin
goal
help handling balafon project configuration.
- author : C.A.D. BONDJE DOUE (cbondje@igkdev.com)
require
balafon php framework
(https://balafon.igkdev.com/get-download)balafon
cli must be installed as global path (and be executable for UNIX system)php8+
check with this command:
balafon --version
installation
npm -i vite-plugin-balafon
or
yarn add vite-plugin-balafon
Note: this package depend on cli-color
and vite
usage
- in vite.config.js
import balafon from 'balafon-vite-plugin'
export default defineConfig({
// ...
plugins:[
// ...
balafon()
]
})
in application
virtual:balafon-corejs
: to inject balafon core script. used in development to gain access tobalafon.core.js
library. will inject$igk
as globalVariable andglobalThis.igk
-- usage
import 'virtual:balafon-corejs';
$igk(...);
virtual:balafon-corejs
: inject framework dynamic core css.virtaul:balafon-project-settings
: retrieve controller application session depend of the plugins (dev|production must be dynamic resolved)
option to pass to balafon config
{
"leaveIndexHtml": {
"type":"boolean",
"description":"do not remove index.html"
},
"cwdir":{
"type":"string",
"description":"controller working directory"
},
"controller":{
"type":"string",
"description":"target controller name"
},
"useRoute":{
"type":"boolean",
"description":"active plugin use of routes definition"
},
"usePiniaStore":{
"type":"boolean",
"description":"active plugin use of pinia store"
},
"logo":{
"type":"string",
"description":"location to .svg logo relative to application working directory to be included "
},
"defaultUser":{
"type":"string",
"description":"login of the user to uses"
},
"buildCoreAssetOutput":{
"type":"string",
"description": "sub assets folder wher to store core assets. default will be \"balafon/\""
},
"buildCoreJSAsAsset":{
"type":["boolean"],
"description":"ask to deploy CoreJs as asset"
},
"buildCoreCssAsAsset":{
"type":["boolean"],
"description":"ask to deploy CoreCss as assets"
},
"buildIconLibAsAsset":{
"type":"boolean",
"default":false,
"description":"ask to deploy Icons libraries as assets"
},
"icons":{
"type":"object",
"description":"manage svg icons for the projects"
},
"componentUri":{
"type":"string",
"description": "indicate entry component server."
}
}
plugins createApp Override
import { createApp } from 'virtual:balafon-vite-app'
import { createSSRApp } from 'virtual:balafon-vite-app'
declerate icons for production
library: string => folder_that_contains_svg_or_vue, list_of_file_to_import
- Features I18n
"formats" in json spécifie formatting to used
or "text.formats" the new text to use