[AC-6633] Reduce compiled TSS file size
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | n/a |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Michael Gangolf |
| Assignee | Abir Mukherjee |
| Created | 2020-11-20T16:58:38.000+0000 |
| Updated | 2020-11-21T19:15:53.000+0000 |
Description
*Problem*
Currently an app.tss file is compiled into every "/android/alloy/styles/" style and increases it's file size and has redundant code.
*Example*
E.g. if you have a very large app.tss (1MB) and 5 controllers with no style you'll end up with five 1MB files (= 5MB total) instead of one 1MB and five empty files (= 1MB total).
*Idea:*
Controllers use require to include alloy or other controllers already. Why not create a /Resources/android/alloy/styles/app.js file and include that file in the other compiled styled file and merge it to their style.
I've already tried to edit https://github.com/appcelerator/alloy/blob/1b9fd4685f0a6abebe1620b021c1d360523f9e8b/Alloy/commands/compile/index.js#L673 and I'm able to write a appTss.js file. I just have trouble including it in the other style files. Tried it with require but it doesn't seem to work here
This also affects iOS Apps. "/Resources/iphone/alloy/styles/style-files-from-all-views"