[CLI] Run Middleman local server but making it believes is in building mode

Is there any way to run middleman with the local server bundle exec middleman server but adding something somewhere to make it believe it is building the site?

I have coded a multi-lingual site, and I need to test what the URLs will look like one built, but I can’t build the site all the time as it takes ages.

The best I could think of is adding a variable at CLI, but I’m not sure I can actually read from within the config.rb file to set my variables.

Any idea?

Apparently something similar I was asking was available in middleman v3 though I haven’t checked the source code to confirm this is the case.

I have in fact found this issue mentioning a -e argument with which a the production environment can be set.

Regrettably, by adding a puts app.production? in within the configure: development block returns false thus suggesting this is no longer supported.

I’ve made a little HTML partial for debugging various I18n-related stuff and have it conditionally turned on in config.rb. It’s CSS-styled to float in the corner of the page (it’s turned off when building), so I can see various parameters when something goes wrong.

The url_for current_page will print-out the output URL for the current page, as will be done in build. It shows correct values for current locale, honoring localized paths, if you use them. It might help.