componentjs / builder2.js

builder for component
50 stars 20 forks source link

Plugins for dummies #55

Closed gnimmelf closed 10 years ago

gnimmelf commented 10 years ago

Rephrase: How does custom builders get called during component build?

jonathanong commented 10 years ago

what do you mean? you have to use the JS API to use your own plugins

gnimmelf commented 10 years ago

Yup, I'm missing vital parts of the picture here :'(

  1. Write a builder plugin ('my-plug.js')
  2. Write a builder ('my-builder.js') that 'use' the plugin
  3. [Missing steps]
  4. Run 'component build'?

Guess I need to see a 101 tutorial.

gnimmelf commented 10 years ago

Ok, I see now (bloody hard to google 'component' by the way). I was expecting a way to add preprocess hooks in the components themselves, e.g a component.json {"builder": "builder.js"} setting, and then just run component build... but I see now that the local builders have to be run individually and manually (e.g. makefiles). Dah, no wonder I had a hard time, blinded by my own assumption of elegance ;-)

jonathanong commented 10 years ago

yeah that was my goal, but i think at that point it just gets too complicated

gnimmelf commented 10 years ago

Oh ok, too bad. Will keep my fingers crossed =) Thanks.

gnimmelf commented 10 years ago

FWIW, I made a simple preprocessor for component, https://www.npmjs.org/package/component-preprocessor