aurajs / aura

A scalable, event-driven JavaScript architecture for developing component-based applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to Concatenate the files of the decoupled modules

wangyuelucky opened this issue · comments

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?

Hello @wangyuelucky not sure I understand your question

@sbellity ,Sorry for my poor English.

Shortly,

  1. I want to concatenate scripts by use of the relationship between modules.
  2. 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.

RequireJS is baked into Aura, you can use features like bundles, packages, and dependencies to build optimized files.

@josephspens thanks all the same.