No commit activity in last 3 years
No release in over 3 years
middleman-webpack creates a ws to trigger client reload
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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).

License

MIT