cayrusa / SA-map-editor

0 stars 1 forks source link

Added npm script buildCode that only build the code without reextract… #4

Closed cayrusa closed 2 years ago

cayrusa commented 2 years ago

…ing the assets

It's npm run buildCode The idea is that it's annoying to see the build script spend time reextracting the assets and re-moving them to the dist folder every time I want to try a code change. This build script is meant to be used after the normal one has already packaged the assets and it just builds the code, assuming the assets are already packaged.

cayrusa commented 2 years ago

@LokiMidgard can you have a look at this code? It works, but since you have more experience than me in this domain, maybe there's a better way to do it?

LokiMidgard commented 2 years ago

You could also automate it without the flag. When extracting you could create an empty file named delete_me_to_reextract_assets. Every build you just check if the file exists.

The first build when missing the assets it will download extract and create an empty file delete_me_to_reextract_assets. After that it will no longer try that.

You could also just check if the zip is there. When not download and extract, otherwise you know it was already extracted. As long no one manually deletes something from dist, it will work.

You then could still use a flag to force the download.

LokiMidgard commented 2 years ago

You should also change the readme according. It is always good to tell people how to build a project ;)

cayrusa commented 2 years ago

You could also automate it without the flag. When extracting you could create an empty file named delete_me_to_reextract_assets. Every build you just check if the file exists.

The first build when missing the assets it will download extract and create an empty file delete_me_to_reextract_assets. After that it will no longer try that.

You could also just check if the zip is there. When not download and extract, otherwise you know it was already extracted. As long no one manually deletes something from dist, it will work.

You then could still use a flag to force the download.

I see. I feel like it's trying to be a bit too smart. The simpler the better I think.

You should also change the readme according. It is always good to tell people how to build a project ;)

Definitely! I was planning on doing that after being sure of what the feature was going to look like. :)

cayrusa commented 2 years ago

I re-added the copy of /assets and /css and updated the readme.