componentjs / component

frontend package manager and build tool for modular web applications
https://github.com/componentjs/guide
MIT License
4.55k stars 306 forks source link

How to install dependencies to a particular folder? #640

Closed g105b closed 8 years ago

g105b commented 8 years ago

A simple component.json config:

{
  "dependencies": {
    "necolas/normalize.css": "3.0.*"
  }
}

When I run component build, the css file gets put into components/necholas/normalize.css/3.0.3/normalize.css, but I would like to specify where client side source files are put, to integrate with my current build system.

I would like to specify that CSS source files get installed to src/Style/Lib and that JS source files get installed to src/Script/Lib, matching the same folder hierarchy that I get from within the components folder at the moment.

Is this possible? If not, is this a valid feature request?

vendethiel commented 8 years ago

I think it's possible with a builder option, no? I don't think it's part of the .componentrc file, though.

timaschew commented 8 years ago

When I run component build, the css file gets put into components/necholas/normalize.css/3.0.3/normalize.css

That's not completely true. I think you misunderstood the usage of component build and component install. component build call internally component install if it does not find the dependencies in the components directory.

component install does install all your dependencies into the components directory, it's like npm and node_modules and you should not use these files directly! With component build you can bundle the files (to use them in the browser), if you're using the CLI you can specify the name and directory of the js and css file, you can run component build --help to find out which options are provided.

But in your case you don't want to put the js and css files together into one directory, so then you need to use the builder API

BUT you should consider to use another tool, because component is deprecated already.