Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make component.json optional #21

Closed
edjafarov opened this issue Jun 12, 2013 · 5 comments
Closed

make component.json optional #21

edjafarov opened this issue Jun 12, 2013 · 5 comments

Comments

@edjafarov
Copy link

https://github.com/anthonyshort/grunt-component-build/blob/master/tasks/component_build.js#L76
need to check if component.json exists before requiring it.
I want to get js files dynamically instead of supporting component.json

@edjafarov
Copy link
Author

Lame, builder.js loads component.json anyway, unless you hack Builder.prototype.json which is great since you can inject config directly.

@edjafarov
Copy link
Author

I did that and it works! But feels like a hack until builder.js will be fixed. Hope that will be done soon https://twitter.com/tjholowaychuk/status/344181701565624321

Until that my fork kinda works https://github.com/edjafarov/grunt-component-build

@edjafarov edjafarov reopened this Jun 13, 2013
@kewah
Copy link
Collaborator

kewah commented Jun 14, 2013

Hi,

I don't really see the benefit to define the component config in Gruntfile instead of a separated file (component.json). Do you have an example ?

Moreover I think your update doesn't cover all needs. Currently you can define images, fonts, scripts and styles properties (https://github.com/edjafarov/grunt-component-build/blob/master/tasks/component_build.js#L49-L52) but if I use the json builder plugin I need to define it too. For example

"json": [
  "path/to/a/json/file.json"
]

@anthonyshort
Copy link
Owner

Yeah I'm pretty against something like this. The whole point is to be able to build components. To build them without needing a manifest wouldn't be using Component properly. You'd be better off writing a custom grunt plugin for this that just gives access to the builder. But I still think it's a bad idea to go that way. 

@edjafarov
Copy link
Author

Well, the reason behind this is to able to define scripts, styles and other assets as a wildcards (like in readme - "You can specify scripts and styles within Grunt and these will override the component.json file. "). And use builder.js for building local project (check https://github.com/edjafarov/compy/blob/master/Gruntfile.js#L21-L30). That would be great to have single grunt plugin for that and building separate components.
Otherwise - yep forking separate plugin is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants