absolvent / gore-gulp

Simple way to run and maintain React.js projects without any configuration.
MIT License
1 stars 0 forks source link

Option to configure multiple source directories #1

Closed kl3ryk closed 9 years ago

kl3ryk commented 9 years ago

In package.json eg:

    "directories": {
        "lib": "Src/Acme/**Bundle/Resources/public/js/"
    },

This feature will be appreciated by symfony developers. Applications written in symfony consist from Bundles. Each bundle can have it's own resources - images, javascripts, stylesheets etc. Eg.:

Src/Acme/FooBundle/Resources/public/js/
Src/Acme/BarBundle/Resources/public/js/
Src/Acme/BazBundle/Resources/public/js/

So we have javascript files splitted logically into different directories. There should be possibility to import files between bundles transparently. Eg.: Should be

import Foo from "Bar"

Insetead of

import Foo from "Src/Acme/BarBundle/Resources/public/js/Bar"
mcharytoniuk commented 9 years ago

My proposal is to use prefixed library names. If you are using single entry point this configuration file is sufficient:

{
    "directories": {
        "dest": "dest",
        "lib": "src"
    },
    "name": "my-package"
}

If you want to configure several entry points you can use both glob pattern and prefixed names:

{
    "directories": {
        "lib1.dest": "dest",
        "lib1.lib": "src/lib1",
        "lib2.dest": "dest",
        "lib2.lib": "src/lib2"
    },
    "name": "my-package"
}

I am considering nested objects also but I want this config to stay as close to official NPM's package.json spec as possible

mcharytoniuk commented 9 years ago

Doable via:

{
  "directories": {
    "lib": [ 
      "firstlib",
      "secondlib"
    ]
  }
}