how to Concatenate the files of the decoupled modules
wangyuelucky opened this issue · comments
wangyue commented
As recommoned, our modules pub/sub events of interest rather than directly communicating with each other, that cutting off the direct relationship between modules.
Our Module file structure as following:
Module A
- define File A
- Publish message A
- File A Logic
Module B
- define File B
- Subscribe message A
- File B Logic
Module C
- define File C
- Publish message C
- File C Logic
Module D
- define File D
- Subscribe message C
- File D Logic
And I want the Concatenation output:
Release folder
- a.js // combine Module A and B
- c.js // combine Module C and D
how can we achieve that?
Stephane Bellity commented
Hello @wangyuelucky not sure I understand your question
wangyue commented
@sbellity ,Sorry for my poor English.
Shortly,
- I want to concatenate scripts by use of the relationship between modules.
- But because of the pub/sub pattern cause modules loose the relation.
By the way,I would not like to Concatenate all modules into only one file.
Joseph Spens commented
RequireJS is baked into Aura, you can use features like bundles, packages, and dependencies to build optimized files.
wangyue commented
@josephspens thanks all the same.