middleman-webpack
Shamlessly based on middleman-livereload. Needed to refresh on sitemap changes, thus, there it is.
This extension will add a WebSocket to which the frontend package webpack-middleman can connect to and watch for events.
Installation
If you already have a Middleman project:
Add gem "middleman-webpack", "~> 0.0.1"
to your Gemfile and run bundle install
Configuration
Inside your config.rb, activates the middleman_webpack
extension:
...
activate :middleman_webpack, :ignore => [
/assets\//,
]
...
There three different options that can be set:
-
:host
Specify the host to which the WebSocket will bind to. Default: 0.0.0.0 -
:port
Specify the port to which the WebSocket will bind to. Default: 25123 -
:ignore
Array of /patterns/ to ignore. Default: []
Example
activate :middleman_webpack, :host => '1.2.3.4', :port => '12345', :ignore => [
/assets\//,
]
This configuration will bind the WebSocket server to the host 1.2.3.4
on port 12345
, and exclude any changes applied in the /assets/
folders (according to the sitemap generated by Middleman).