mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
basic ability to overwrite some config options in browser
This commit is contained in:
@@ -6,7 +6,8 @@ var isFileProtocol = (location.protocol === 'file:' ||
|
||||
location.protocol === 'chrome:' ||
|
||||
location.protocol === 'resource:');
|
||||
|
||||
less.env = location.hostname == '127.0.0.1' ||
|
||||
less.env = less.env ||
|
||||
location.hostname == '127.0.0.1' ||
|
||||
location.hostname == '0.0.0.0' ||
|
||||
location.hostname == 'localhost' ||
|
||||
location.port.length > 0 ||
|
||||
@@ -22,7 +23,7 @@ less.env = location.hostname == '127.0.0.1' ||
|
||||
less.async = false;
|
||||
|
||||
// Interval between watch polls
|
||||
less.poll = isFileProtocol ? 1000 : 1500;
|
||||
less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
|
||||
|
||||
//
|
||||
// Watch mode
|
||||
|
||||
@@ -4,7 +4,8 @@ if (typeof(window) === 'undefined') {
|
||||
less = exports,
|
||||
tree = require('less/tree');
|
||||
} else {
|
||||
less = window.less = {},
|
||||
if (typeof(window.less) === 'undefined') { window.less = {} }
|
||||
less = window.less,
|
||||
tree = window.less.tree = {};
|
||||
}
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user