nikushi / minipack

Minipack, a gem for minimalists, which can integrates Rails with webpack. It is an alternative to Webpacker.
MIT License
115 stars 22 forks source link

Plugin loader #17

Closed nikushi closed 5 years ago

nikushi commented 5 years ago

When you write minipack_plugin.rb, it will be loaded along side Minipack.

ref: https://guides.rubygems.org/plugins/

My expected initialization sequence is as follows:(may change in the future)

loading gems by bundler
  |
  v
loading minipack gem
    \
     -> loading minipack plugins' minipack_plugin.rb 
       -> Define config parameters, run anything, or register hooks(not implemented though)
  |
  v
Rails application initialization process
    \
     -> load config/initializers/minipack.rb to setup configuration
  |
  v
call after_initialize hooks? (not implemented)
nikushi commented 5 years ago

I've reverted in 23df01581bf8d3b5c62fda0acdea6c18b941a4b3. I decided not to introduce a plugin system in this version.

Because it is not a required feature to anyone. I tried to rspec.rb to the other gem minipack-rspec as a plugin, but just keeping rspec.rb in minipack gem right now.