How to enable javascript in middleman 4?

I used Middleman for a while, and it always used the Rails pipeline to enable javascript and css. Therefore, to include a javascript module called "thing.js" in the same directory, follow these steps:

//= require thing

But since Middleman 4 seems to have changed, and I cannot find any documentation. The closest I can find is this page, which shows me how to start compiling ember.js: https://middlemanapp.com/advanced/external-pipeline/

So ... if I want to upload javascript files to Middleman, do I need to minimize my own build system? Or am I missing something?

+4
source share
1 answer

The easy answer was to include middleman-sprockets gem. Thus, everything will work as before.

Add this to your gemfile

gem 'middleman-sprockets', '~> 4.0.0.rc.1' 

Run the package installation.

You don’t need to activate anything, activate the extension of the star broker

+6
source

Source: https://habr.com/ru/post/1628107/


All Articles