# Run flutter web on FiveM CEF 1.**替換源碼HTML至** ```htmlembedded= <!DOCTYPE html> <html> <head> <base href="/html/"> <meta charset="UTF-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <title>set your projectName</title> <link rel="manifest" href="manifest.json"> </head> <body> <script> var scriptLoaded = false; function loadMainDartJs() { if (scriptLoaded) { return; } scriptLoaded = true; var scriptTag = document.createElement('script'); scriptTag.src = 'main.dart.js'; scriptTag.type = 'application/javascript'; document.body.append(scriptTag); } loadMainDartJs(); </script> </body> </html> ``` 2. **在build/資料夾下放置bat檔(與web資料夾同路徑)**[remove_files_for_Fivem.bat(點我下載)](https://cdn.discordapp.com/attachments/817454204108144661/1077344351191056574/remove_files_for_Fivem.bat) 3. **build指令: `flutter build web --web-renderer canvaskit --no-source-maps && %cd%/build/remove_files_for_Fivem.bat `**(使用 canvaskit 渲染並不產生src maps最後bat檔會自動刪除不必要的檔案) **如使用vs code terminal記得先打cmd切至cmd** 4. **在要使用的插件上配置fxmanifest.lua** ```lua fx_version 'bodacious' games { 'gta5' } description "flutter UI" ui_page "html/index.html" files { "html/index.html", "html/*.png", "html/**/*.png", "html/*.js", "html/**/*.js", "html/*.json", "html/**/*.json", "html/**/*.wasm", "html/**/*.otf", "html/**/*.ttf", } -- client_script "client.lua" ``` 5. **Start Resource**
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up