I've been using Middleman for a while and it always used the Rails asset pipeline for including javascript and css. So to include a javascript module called "thing.js" in the same directory, you'd do:
//= require thing
But since Middleman 4, that seems to have changed and I can't find any documentation. The closest thing I can find is this page which shows me how to run an ember.js compilation: https://middlemanapp.com/advanced/external-pipeline/
So... if I want to load javascript files in Middleman now, do I have to roll my own build system? Or am I missing something?
The easy answer was to include the middleman-sprockets gem. That way things will work like they used to.
Add this to your gemfile
gem 'middleman-sprockets', '~> 4.0.0.rc.1'
Run bundle install.
You don't need to activate anything, the middleman-sprockets extension auto-activates
The easy answer was to include the middleman-sprockets gem. That way things will work like they used to.
Add this to your gemfile
gem 'middleman-sprockets', '~> 4.0.0.rc.1'
Run bundle install.
You don't need to activate anything, the middleman-sprockets extension auto-activates
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With