Skip to content

Commit

Permalink
serve and zip bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewR3K committed Mar 9, 2024
1 parent 74cb890 commit f74d711
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ui/build/fxupdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ fs.readFile('../fxmanifest.lua', 'utf8', function (err, data) {
"ui/img/*.*"
}`

let to_file = 'ui/shim.html';
let from_file = 'ui/index.html'

if (process.env.NODE_ENV === 'development') {
replace =
`files {
"ui/shim.html"
}`

to_file = 'ui/index.html';
from_file = 'ui/shim.html';
}

data = data.replaceAll(to_file, from_file)
data = data.replaceAll(expr, replace)

fs.writeFile ('../fxmanifest.lua', data, function(err) {
Expand Down
5 changes: 3 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"scripts": {
"serve": "NODE_ENV=development yarn run shim && vue-cli-service serve",
"build": "NODE_ENV=production yarn run shim && vue-cli-service build",
"build:local": "NODE_ENV=local yarn run shim && vue-cli-service build && ZIP=true yarn run local",
"build:local:unzip": "NODE_ENV=local yarn run shim && vue-cli-service build && yarn run local",
"build:local": "cross-env NODE_ENV=local yarn run shim && vue-cli-service build && cross-env ZIP=true yarn run local",
"build:local:unzip": "cross-env NODE_ENV=local yarn run shim && vue-cli-service build && yarn run local",
"lint": "vue-cli-service lint",
"shim": "node build/fxupdate.js",
"local": "node build/local.js"
Expand All @@ -31,6 +31,7 @@
"@vue/cli-service": "~5.0.0",
"archiver": "^7.0.0",
"colors": "^1.4.0",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"sass": "^1.32.7",
Expand Down
9 changes: 8 additions & 1 deletion ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,13 @@ crc32-stream@^6.0.0:
crc-32 "^1.2.0"
readable-stream "^4.0.0"

cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^5.0.1:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
Expand All @@ -2723,7 +2730,7 @@ cross-spawn@^6.0.0:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down

0 comments on commit f74d711

Please sign in to comment.