From de5edb2627798da388a584f8a40f37b2e3b743d0 Mon Sep 17 00:00:00 2001 From: "CORP\\sermyazhko.anton" Date: Fri, 24 Aug 2018 11:25:00 +0300 Subject: [PATCH 1/2] Added CSS autoprefixer as 'less-plugin-autoprefix' --- build/style-compiler/NodeRunner.cs | 9 ++++++++- package.json | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/build/style-compiler/NodeRunner.cs b/build/style-compiler/NodeRunner.cs index c2b656cbe95f..c28db1813ac9 100644 --- a/build/style-compiler/NodeRunner.cs +++ b/build/style-compiler/NodeRunner.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics; using System.IO; +using Newtonsoft.Json; namespace StyleCompiler { @@ -11,7 +12,13 @@ static class NodeRunner public static string CompileLess(string less) { - return RunExternalApp(ResolveNodeToolPath("node"), "node_modules/less/bin/lessc -", Utils.GetRepoRootPath(), less); + return RunExternalApp(ResolveNodeToolPath("node"), $"node_modules/less/bin/lessc --autoprefix=\"{ReadBrowsersList()}\" -", Utils.GetRepoRootPath(), less); + } + + static string ReadBrowsersList() + { + dynamic manifest = JsonConvert.DeserializeObject(File.ReadAllText(Path.Combine(Utils.GetRepoRootPath(), "package.json"))); + return string.Join(",", manifest["browserslist"]); } static string RunExternalApp(string path, string arguments, string workingDirectory, string stdIn) diff --git a/package.json b/package.json index ce23ae6aaf22..f1628d6fc73d 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "knockout": "^3.4.2", "lazypipe": "^1.0.1", "less": "^2.7.1", + "less-plugin-autoprefix": "^2.0.0", "lint-staged": "^3.4.0", "merge-stream": "^1.0.0", "mustache": "2.3.0", @@ -104,5 +105,11 @@ "dev": "gulp dev", "test-env": "node testing/launch" }, + "browserslist": [ + "last 2 versions", + "ios > 7", + "ie > 10", + "> 1%" + ], "pre-commit": "lint-staged" } From 20aa756d1737ec37895f8830eb007e6145c14f7a Mon Sep 17 00:00:00 2001 From: "CORP\\sermyazhko.anton" Date: Fri, 24 Aug 2018 15:53:50 +0300 Subject: [PATCH 2/2] Change supported iOS versions to 9+ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f1628d6fc73d..8e316950b1fb 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ }, "browserslist": [ "last 2 versions", - "ios > 7", + "ios > 8", "ie > 10", "> 1%" ],