mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
use isFileProtocol variable for dryness
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
(function () {
|
||||
|
||||
var isFileProtocol = location.protocol === 'file:';
|
||||
|
||||
less.env = location.hostname == '127.0.0.1' ||
|
||||
location.hostname == '0.0.0.0' ||
|
||||
location.hostname == 'localhost' ||
|
||||
location.protocol == 'file:' ||
|
||||
location.port.length > 0 ? 'development'
|
||||
location.port.length > 0 ||
|
||||
isFileProtocol ? 'development'
|
||||
: 'production';
|
||||
|
||||
// Load styles asynchronously (default: false)
|
||||
@@ -16,7 +18,7 @@ less.env = location.hostname == '127.0.0.1' ||
|
||||
less.async = false;
|
||||
|
||||
// Interval between watch polls
|
||||
less.poll = location.protocol == 'file:' ? 1000 : 1500;
|
||||
less.poll = isFileProtocol ? 1000 : 1500;
|
||||
|
||||
//
|
||||
// Watch mode
|
||||
|
||||
Reference in New Issue
Block a user