royale-asjs icon indicating copy to clipboard operation
royale-asjs copied to clipboard

js-debug vs js-release

Open sanjeev-rajput opened this issue 3 years ago • 4 comments

1. CSS file Build works with "js-debug" but in "js-release" compiler change file name Main.css to Main.min.css but entry of css file doesn't reflects in "index.html"

either css file name should not be change or correct new file name must be added in index.html

2. Reading JSON file

in "js-debug"

_data is a JSON object

for each(var i:Object in _data){ trace(i.topic); } this works perfectly fine in "js-debug" but doesn't works in "js-release" it has to be change as below

for each(var i:Object in _data){ trace(i['topic']); }

"js-debug" approach is standard one i think "js-release" must follow the same

sanjeev-rajput avatar Dec 21 '22 09:12 sanjeev-rajput

Regarding your first point: What does your template html file look like? Make sure you have the ${head} token. Your minified css file should be correctly linked.

Regarding your second point, please read this page: https://apache.github.io/royale-docs/create-an-application/optimizations/minification

Harbs avatar Dec 21 '22 12:12 Harbs

Actually, here's what I have in my template file: <link rel="stylesheet" type="text/css" href="${application}.css?{build_number}">

${application}.css becomes MyApp.css in debug and MyApp.min.css in release. I have a build script which appends the build number for cache-busting.

Harbs avatar Dec 21 '22 12:12 Harbs

@Harbs - it does works

the main confusion is - you won't find "Main.min.css" in debug mode but it appears in "js-release"

this is what my index-template.html

Learning Module
${head}
${body}

asconfig.json { "config": "royale", "compilerOptions": { "debug": true, "targets": ["JSRoyale"], "source-map": true, "html-template": "src/assets/config/resources/index-template.html", "theme": "${royalelib}/themes/JewelTheme/src/main/resources/defaults.css" }, "copySourcePathAssets": true, "additionalOptions": "-remove-circulars -js-output-optimization=skipAsCoercions", "files": [ "src/Main.mxml" ] }

sanjeev-rajput avatar Dec 22 '22 05:12 sanjeev-rajput

It does probably make sense to not add the min. to the name for release. It doesn't really add anything.

Harbs avatar Dec 22 '22 08:12 Harbs

this issue has been resolved in latest version

sanjeev-rajput avatar Jul 19 '25 11:07 sanjeev-rajput