azproduction / lmd

LMD - JavaScript Module-Assembler for building better web applications :warning: Project is no longer supported :warning:
http://azproduction.ru/lmd/
MIT License
449 stars 27 forks source link

Mixins in command line overrides mixins in config file #187

Closed jeron-diovis closed 10 years ago

jeron-diovis commented 10 years ago

Let say I have following files:

index.lmd.json:

{
    "name": "index build",
    "root": "../",
    "output": "index.lmd.js",
    "modules": {
        "main": "the_litte_brave_module.js"
    },
    "main": "main",
    "mixins": [ "./mixin_stats.lmd.json" ]
}

mixin_stats.lmd.json:

{
    "stats": true
}

mixin_amd.lmd.json:

{
    "amd": true
}

By building just "index" I have "stats" mixin used, as expected:

$ lmd build index | grep mixin && cat index.lmd.js | grep 'sb.require.stats' 
info:    Extra mixins ./mixin_stats.lmd.json
sb.require.stats = function (moduleName) {

But by adding another mixin in CLI, only that one is used:

$ lmd build index+mixin_amd | grep mixin && cat index.lmd.js | grep -E '(sb.require.define)|(sb.require.stats)' 
info:    Extra mixins mixin_amd.lmd.json
sb.require.define = define;

Is this correct behaviour? For simple flags - obviously, it is. But collections should be extendable. At least, some option for enabling such functionality would be useful. After all, config file always is base for build, so it's data should not be just silently lost.

azproduction commented 10 years ago

This is incorrect behavior. Extra mixins should be appended. I'll fix this.

azproduction commented 10 years ago

fixed in lmd@1.13.3