Skip to content

Commit

Permalink
[BREAKING] Remove support for 'sourceMap' / 'cleancss' options
Browse files Browse the repository at this point in the history
This change uses a modified version of less which is part of this
project. The dependencies "clean-css" and "source-map" are not included
anymore and providing the corresponding options will result in an error.

The "mime" dependency has been updated to resolve #25.

Fixes: #25
  • Loading branch information
matz3 committed Nov 14, 2019
1 parent deb67f9 commit 3f234c8
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 133 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/thirdparty/
19 changes: 19 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,22 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

------------------------------------------------------------------------------
APIs

This project may include APIs to SAP or third party products or services. The use of these APIs, products and services may be subject to additional agreements. In no event shall the application of the Apache Software License, v.2 to this project grant any rights in or to these APIs, products or services that would alter, expand, be inconsistent with, or supersede any terms of these additional agreements. “API” means application programming interfaces, as well as their respective specifications and implementing code that allows other software products to communicate with or call on SAP or third party products or services (for example, SAP Enterprise Services, BAPIs, Idocs, RFCs and ABAP calls or other user exits) and may be made available through SAP or third party products, SDKs, documentation or other media.

------------------------------------------------------------------------------
SUBCOMPONENTS

This project includes the following subcomponents that are subject to separate license terms.
Your use of these subcomponents is subject to the separate license terms applicable to
each subcomponent.

Component: less.js
Licensor: Alexis Sellier
Website: http://lesscss.org/
License: Apache License 2.0
<year> = 2014
<copyright holders> = Alexis Sellier & The Core Less Team
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ Type `object`

Options for the [less](http://lesscss.org) compiler (`tree.toCss`).

**Note:** The options `sourceMap` and `cleancss` are not supported. An exception will be thrown when used.

##### library.name

Type `string`
Expand Down
7 changes: 7 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ Builder.prototype.build = function(options) {
scope: {}
}, options);

if (options.compiler.sourceMap) {
throw new Error("compiler.sourceMap option is not supported!");
}
if (options.compiler.cleancss) {
throw new Error("compiler.cleancss option is not supported! Please use 'clean-css' directly.");
}

// Set default of "relativeUrls" parser option to "true" (less default is "false")
if (!Object.prototype.hasOwnProperty.call(options.parser, "relativeUrls")) {
options.parser.relativeUrls = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/less/importsPush.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/* eslint-disable consistent-this, new-cap, no-invalid-this */
"use strict";

const less = require("less");
const less = require("../thirdparty/less");
const tree = less.tree;

module.exports = function createImportsPushFunction(env, fileLoader, parserFactory) {
Expand Down
2 changes: 1 addition & 1 deletion lib/less/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* eslint-disable new-cap */
"use strict";

const less = require("less");
const less = require("../thirdparty/less");
const createFileLoader = require("./fileLoader");
const createImportsPushFunction = require("./importsPush");

Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/import-collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"use strict";

const less = require("less");
const less = require("../thirdparty/less");

const ImportCollector = module.exports = function(options) {
/* eslint-disable new-cap */
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"use strict";

const less = require("less");
const less = require("../thirdparty/less");

const cssSizePattern = /(-?[.0-9]+)([a-z]*)/;
const percentagePattern = /^\s*(-?[.0-9]+)%\s*$/;
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin/variable-collector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"use strict";
const path = require("path");
const less = require("less");
const less = require("../thirdparty/less");

const VariableCollector = module.exports = function(env) {
/* eslint-disable new-cap */
Expand Down

0 comments on commit 3f234c8

Please sign in to comment.