@zohodesk/react-cli 1.1.16-exp.2 → 1.1.16-exp.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +8 -0
- package/lib/loaderUtils/getCSSLoaders.js +1 -1
- package/lib/schemas/index.js +12 -0
- package/lib/utils/autoprefixer.js +52 -0
- package/npm-shrinkwrap.json +30 -32
- package/package.json +2 -2
- package/lib/postcss-plugins/AutoPrefixer.js +0 -194
package/bin/cli.js
CHANGED
@@ -76,6 +76,14 @@ switch (option) {
|
|
76
76
|
{ stdio: 'inherit' }
|
77
77
|
);
|
78
78
|
|
79
|
+
process.exit(result.status);
|
80
|
+
break;
|
81
|
+
case 'autoprefix':
|
82
|
+
result = spawnSync(
|
83
|
+
'node',
|
84
|
+
[require.resolve('../lib/utils/autoprefixer')].concat(args),
|
85
|
+
{ stdio: 'inherit' }
|
86
|
+
);
|
79
87
|
process.exit(result.status);
|
80
88
|
break;
|
81
89
|
case 'variableConverter':
|
@@ -82,7 +82,7 @@ const getCSSLoaders = optionsObj => {
|
|
82
82
|
|
83
83
|
return `${prefix} ${selector}`; // Make selectors like [dir=rtl] > .selector
|
84
84
|
}
|
85
|
-
}), plugins.selectorReplace && require('../postcss-plugins/SelectorReplace')(selectorReplace), plugins.combinerMediaQuery && require('postcss-combine-media-query')(), plugins.hoverActive && require('../postcss-plugins/hoverActivePlugin')(mediaQueryHoverActiveString), plugins.cssVariableReplacement && fs.existsSync(cssVariableReplacementConfig) && require('../postcss-plugins/variableModificationPlugin/index').plugin(cssVariableReplacementConfig), plugins.autoPrefixer && require('
|
85
|
+
}), plugins.selectorReplace && require('../postcss-plugins/SelectorReplace')(selectorReplace), plugins.combinerMediaQuery && require('postcss-combine-media-query')(), plugins.hoverActive && require('../postcss-plugins/hoverActivePlugin')(mediaQueryHoverActiveString), plugins.cssVariableReplacement && fs.existsSync(cssVariableReplacementConfig) && require('../postcss-plugins/variableModificationPlugin/index').plugin(cssVariableReplacementConfig), plugins.autoPrefixer && require('@zohodesk-private/prefix_remove/es/cli_plugin/AutoPrefixer')(prefixConfig) // require('autoprefixer')({ flexbox: true, grid: false })
|
86
86
|
// ,
|
87
87
|
// plugins.composeMinification &&
|
88
88
|
// require('../postcss-plugins/composePlugin')()
|
package/lib/schemas/index.js
CHANGED
@@ -97,6 +97,16 @@ var _default = {
|
|
97
97
|
defaultSelector: '',
|
98
98
|
customFileDetails: '',
|
99
99
|
excludeStrings: []
|
100
|
+
},
|
101
|
+
prefixConfig: {
|
102
|
+
include: {},
|
103
|
+
exclude: [],
|
104
|
+
removerExclude: [],
|
105
|
+
replacements: null,
|
106
|
+
browsers: null,
|
107
|
+
defaultPrefixesPath: '',
|
108
|
+
removedPropertyPath: '',
|
109
|
+
prefixesPresentPath: ''
|
100
110
|
}
|
101
111
|
},
|
102
112
|
efc: {
|
@@ -294,6 +304,7 @@ var _default = {
|
|
294
304
|
prefixConfig: {
|
295
305
|
include: {},
|
296
306
|
exclude: [],
|
307
|
+
removerExclude: [],
|
297
308
|
replacements: null,
|
298
309
|
browsers: null,
|
299
310
|
defaultPrefixesPath: '',
|
@@ -420,6 +431,7 @@ var _default = {
|
|
420
431
|
prefixConfig: {
|
421
432
|
include: {},
|
422
433
|
exclude: [],
|
434
|
+
removerExclude: [],
|
423
435
|
replacements: null,
|
424
436
|
browsers: null,
|
425
437
|
defaultPrefixesPath: '',
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
+
|
5
|
+
var _AutoPrefixer = _interopRequireDefault(require("@zohodesk-private/prefix_remove/es/cli_plugin/AutoPrefixer"));
|
6
|
+
|
7
|
+
var _path = _interopRequireDefault(require("path"));
|
8
|
+
|
9
|
+
var _fs = _interopRequireDefault(require("fs"));
|
10
|
+
|
11
|
+
var _folderIterator = _interopRequireDefault(require("./folderIterator"));
|
12
|
+
|
13
|
+
var _getOptions = _interopRequireDefault(require("./getOptions"));
|
14
|
+
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
|
17
|
+
let cwd = process.cwd();
|
18
|
+
|
19
|
+
let src = _path.default.join(cwd, process.argv[2]);
|
20
|
+
|
21
|
+
let dist = _path.default.join(cwd, process.argv[3]);
|
22
|
+
|
23
|
+
let canWacth = '-w' === process.argv[4];
|
24
|
+
|
25
|
+
function watchHandler(fromPath, toPath) {
|
26
|
+
let css = _fs.default.readFileSync(fromPath);
|
27
|
+
|
28
|
+
const options = (0, _getOptions.default)();
|
29
|
+
const {
|
30
|
+
prefixConfig
|
31
|
+
} = options.css;
|
32
|
+
(0, _postcss.default)([(0, _AutoPrefixer.default)(prefixConfig)]).process(css, {
|
33
|
+
from: fromPath,
|
34
|
+
to: toPath
|
35
|
+
}).then(result => {
|
36
|
+
_fs.default.writeFile(toPath, result.css, () => true);
|
37
|
+
|
38
|
+
if (result.map) {
|
39
|
+
_fs.default.writeFile(`${toPath}.map`, result.map, () => true);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
}
|
43
|
+
|
44
|
+
(0, _folderIterator.default)(src, dist, ['.css'], false, (fromPath, toPath) => {
|
45
|
+
if (canWacth && fromPath) {
|
46
|
+
_fs.default.watchFile(fromPath, () => {
|
47
|
+
watchHandler(fromPath, toPath);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
watchHandler(fromPath, toPath);
|
52
|
+
});
|
package/npm-shrinkwrap.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.17",
|
4
4
|
"lockfileVersion": 1,
|
5
5
|
"requires": true,
|
6
6
|
"dependencies": {
|
@@ -2118,6 +2118,35 @@
|
|
2118
2118
|
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
2119
2119
|
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
|
2120
2120
|
},
|
2121
|
+
"@zohodesk-private/prefix_remove": {
|
2122
|
+
"version": "1.0.9",
|
2123
|
+
"resolved": "http://cm-npmregistry.csez.zohocorpin.com/@zohodesk-private%2fprefix_remove/-/prefix_remove-1.0.9.tgz",
|
2124
|
+
"integrity": "sha512-EPmcnUlsMjQAt605f7s5DnfJOCDADp50lqaEn+iXES8TBxEzFJqmgxiBHcVLIucLHMGBoYdyiYs664rFlxPp+A==",
|
2125
|
+
"requires": {
|
2126
|
+
"postcss": "^7.0.39"
|
2127
|
+
},
|
2128
|
+
"dependencies": {
|
2129
|
+
"picocolors": {
|
2130
|
+
"version": "0.2.1",
|
2131
|
+
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
|
2132
|
+
"integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA=="
|
2133
|
+
},
|
2134
|
+
"postcss": {
|
2135
|
+
"version": "7.0.39",
|
2136
|
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.39.tgz",
|
2137
|
+
"integrity": "sha512-yioayjNbHn6z1/Bywyb2Y4s3yvDAeXGOyxqD+LnVOinq6Mdmd++SW2wUNVzavyyHxd6+DxzWGIuosg6P1Rj8uA==",
|
2138
|
+
"requires": {
|
2139
|
+
"picocolors": "^0.2.1",
|
2140
|
+
"source-map": "^0.6.1"
|
2141
|
+
}
|
2142
|
+
},
|
2143
|
+
"source-map": {
|
2144
|
+
"version": "0.6.1",
|
2145
|
+
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
2146
|
+
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
2147
|
+
}
|
2148
|
+
}
|
2149
|
+
},
|
2121
2150
|
"@zohodesk/client_packages_group": {
|
2122
2151
|
"version": "1.0.2",
|
2123
2152
|
"resolved": "https://registry.npmjs.org/@zohodesk/client_packages_group/-/client_packages_group-1.0.2.tgz",
|
@@ -2640,27 +2669,6 @@
|
|
2640
2669
|
"resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
|
2641
2670
|
"integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg=="
|
2642
2671
|
},
|
2643
|
-
"autoprefixer": {
|
2644
|
-
"version": "9.8.8",
|
2645
|
-
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.8.8.tgz",
|
2646
|
-
"integrity": "sha512-eM9d/swFopRt5gdJ7jrpCwgvEMIayITpojhkkSMRsFHYuH5bkSQ4p/9qTEHtmNudUZh22Tehu7I6CxAW0IXTKA==",
|
2647
|
-
"requires": {
|
2648
|
-
"browserslist": "^4.12.0",
|
2649
|
-
"caniuse-lite": "^1.0.30001109",
|
2650
|
-
"normalize-range": "^0.1.2",
|
2651
|
-
"num2fraction": "^1.2.2",
|
2652
|
-
"picocolors": "^0.2.1",
|
2653
|
-
"postcss": "^7.0.32",
|
2654
|
-
"postcss-value-parser": "^4.1.0"
|
2655
|
-
},
|
2656
|
-
"dependencies": {
|
2657
|
-
"picocolors": {
|
2658
|
-
"version": "0.2.1",
|
2659
|
-
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz",
|
2660
|
-
"integrity": "sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA=="
|
2661
|
-
}
|
2662
|
-
}
|
2663
|
-
},
|
2664
2672
|
"aws-sign2": {
|
2665
2673
|
"version": "0.7.0",
|
2666
2674
|
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
|
@@ -9944,11 +9952,6 @@
|
|
9944
9952
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
9945
9953
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
|
9946
9954
|
},
|
9947
|
-
"normalize-range": {
|
9948
|
-
"version": "0.1.2",
|
9949
|
-
"resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
|
9950
|
-
"integrity": "sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA=="
|
9951
|
-
},
|
9952
9955
|
"normalize-url": {
|
9953
9956
|
"version": "1.9.1",
|
9954
9957
|
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz",
|
@@ -9997,11 +10000,6 @@
|
|
9997
10000
|
"boolbase": "^1.0.0"
|
9998
10001
|
}
|
9999
10002
|
},
|
10000
|
-
"num2fraction": {
|
10001
|
-
"version": "1.2.2",
|
10002
|
-
"resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz",
|
10003
|
-
"integrity": "sha512-Y1wZESM7VUThYY+4W+X4ySH2maqcA+p7UR+w8VWNWVAd6lwuXXWz/w/Cz43J/dI2I+PS6wD5N+bJUF+gjWvIqg=="
|
10004
|
-
},
|
10005
10003
|
"number-is-nan": {
|
10006
10004
|
"version": "1.0.1",
|
10007
10005
|
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zohodesk/react-cli",
|
3
|
-
"version": "1.1.16-exp.
|
3
|
+
"version": "1.1.16-exp.4",
|
4
4
|
"description": "A CLI tool for build modern web application and libraries",
|
5
5
|
"scripts": {
|
6
6
|
"init": "node ./lib/utils/init.js",
|
@@ -40,13 +40,13 @@
|
|
40
40
|
"@babel/preset-env": "7.11.0",
|
41
41
|
"@babel/preset-react": "7.10.4",
|
42
42
|
"@babel/runtime": "7.11.2",
|
43
|
+
"@zohodesk-private/prefix_remove": "^1.0.9",
|
43
44
|
"@zohodesk/client_packages_group": "1.0.2",
|
44
45
|
"@zohodesk/eslint-plugin-react-performance": "1.0.3",
|
45
46
|
"@zohodesk/eslint-plugin-zsecurity": "0.0.1-beta.4",
|
46
47
|
"@zohodesk/postcss-rtl": "1.5.2",
|
47
48
|
"@zohodesk/propertytojson": "1.0.1",
|
48
49
|
"@zohodesk/screenshot-test": "0.0.1-beta.20",
|
49
|
-
"autoprefixer": "^9.8.8",
|
50
50
|
"babel-eslint": "10.1.0",
|
51
51
|
"babel-jest": "26.3.0",
|
52
52
|
"babel-loader": "8.1.0",
|
@@ -1,194 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _postcss = _interopRequireDefault(require("postcss"));
|
4
|
-
|
5
|
-
var _fs = _interopRequireDefault(require("fs"));
|
6
|
-
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
|
9
|
-
module.exports = _postcss.default.plugin('autoprefixer', prefixConfig => {
|
10
|
-
const filePath = prefixConfig && prefixConfig.defaultPrefixesPath ? prefixConfig.defaultPrefixesPath : './defaultPrefixes.json';
|
11
|
-
|
12
|
-
if (!_fs.default.existsSync(filePath)) {
|
13
|
-
console.error('default prefixes file not found! AutoPrefixer will not work, kindly check!');
|
14
|
-
return;
|
15
|
-
}
|
16
|
-
|
17
|
-
const prefixes = JSON.parse(_fs.default.readFileSync(filePath, 'utf-8'));
|
18
|
-
const prefixVals = Object.keys(prefixes).filter(key => prefixes[key].key);
|
19
|
-
const prefixValObj = {};
|
20
|
-
prefixVals.forEach(val => {
|
21
|
-
prefixValObj[prefixes[val].value] = prefixes[val];
|
22
|
-
});
|
23
|
-
const removedPropertiesPath = prefixConfig && prefixConfig.removedPropertyPath ? prefixConfig.removedPropertyPath : './removedProperties.json';
|
24
|
-
|
25
|
-
if (_fs.default.existsSync(removedPropertiesPath)) {
|
26
|
-
const removedProperties = JSON.parse(_fs.default.readFileSync(removedPropertiesPath, 'utf-8'));
|
27
|
-
const valuesNotFound = [];
|
28
|
-
removedProperties.forEach(property => {
|
29
|
-
if (!Object.keys(prefixes).includes(property) && !Object.keys(prefixConfig.include).includes(property) && !Object.keys(prefixConfig.exclude).includes(property)) {
|
30
|
-
valuesNotFound.push(property);
|
31
|
-
}
|
32
|
-
});
|
33
|
-
|
34
|
-
if (valuesNotFound.length > 0) {
|
35
|
-
console.error('Autoprefixer Properties not Handled : ');
|
36
|
-
valuesNotFound.forEach(value => {
|
37
|
-
console.error(value);
|
38
|
-
});
|
39
|
-
throw new Error('Kindly ensure these properties are handled through defaultPrefixes.json or prefixConfig.include or prefixConfig.exclude ');
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
return root => {
|
44
|
-
root.walkAtRules(rule => {
|
45
|
-
const previous = rule.parent.nodes[rule.parent.nodes.indexOf(rule) - 1];
|
46
|
-
|
47
|
-
if (previous && previous.type === 'comment' && previous.text === 'prefix:ignore') {
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
|
51
|
-
if (rule.name === 'keyframes' && !prefixConfig.exclude.includes('@keyframes') && prefixConfig.include && (Object.keys(prefixConfig.include).length === 0 || Object.keys(prefixConfig.include).includes('@keyframes'))) {
|
52
|
-
const newPrefixes = [];
|
53
|
-
const replacements = prefixConfig.replacements && prefixConfig.replacements['@keyframes'] ? prefixConfig.replacements['@keyframes'] : {}; // if (!prefixes['@keyframes'] && !replacements) {
|
54
|
-
// return;
|
55
|
-
// }
|
56
|
-
|
57
|
-
const mozRule = rule.clone();
|
58
|
-
|
59
|
-
if (mozRule.name && prefixConfig.browsers && prefixConfig.browsers.mozilla) {
|
60
|
-
// custom value need to change
|
61
|
-
if (prefixConfig.include['@keyframes'] && !prefixConfig.include['@keyframes'].mozilla && !prefixes['@keyframes'].mozilla) {
|
62
|
-
return;
|
63
|
-
}
|
64
|
-
|
65
|
-
mozRule.name = replacements && replacements.mozilla ? replacements.mozilla : prefixes['@keyframes'].mozilla;
|
66
|
-
|
67
|
-
if (mozRule.name !== undefined) {
|
68
|
-
newPrefixes.push(mozRule);
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
const chromeRule = rule.clone(); // custom value need to change
|
73
|
-
|
74
|
-
if (chromeRule.name && prefixConfig.browsers && prefixConfig.browsers.chrome) {
|
75
|
-
if (prefixConfig.include['@keyframes'] && !prefixConfig.include['@keyframes'].chrome && !prefixes['@keyframes'].chrome) {
|
76
|
-
return;
|
77
|
-
}
|
78
|
-
|
79
|
-
chromeRule.name = replacements && replacements.chrome ? replacements.chrome : prefixes['@keyframes'].chrome;
|
80
|
-
|
81
|
-
if (chromeRule.name !== undefined) {
|
82
|
-
newPrefixes.push(chromeRule);
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
const operaRule = rule.clone(); // custom value need to change
|
87
|
-
|
88
|
-
if (operaRule.name && prefixConfig.browsers && prefixConfig.browsers.opera) {
|
89
|
-
if (prefixConfig.include['@keyframes'] && !prefixConfig.include['@keyframes'].opera && !prefixes['@keyframes'].opera) {
|
90
|
-
return;
|
91
|
-
}
|
92
|
-
|
93
|
-
operaRule.name = replacements && replacements.opera ? replacements.opera : prefixes['@keyframes'].opera;
|
94
|
-
|
95
|
-
if (operaRule.name !== undefined) {
|
96
|
-
newPrefixes.push(operaRule);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
const ieRule = rule.clone(); // custom value need to change
|
101
|
-
|
102
|
-
if (ieRule.name && prefixConfig.browsers && prefixConfig.browsers.ie) {
|
103
|
-
if (prefixConfig.include['@keyframes'] && !prefixConfig.include['@keyframes'].ie && !prefixes['@keyframes'].ie) {
|
104
|
-
return;
|
105
|
-
}
|
106
|
-
|
107
|
-
ieRule.name = replacements && replacements.ie ? replacements.ie : prefixes['@keyframes'].ie;
|
108
|
-
|
109
|
-
if (ieRule.name !== undefined) {
|
110
|
-
newPrefixes.push(ieRule);
|
111
|
-
}
|
112
|
-
}
|
113
|
-
|
114
|
-
rule.parent.insertAfter(rule, newPrefixes); // console.log(`${rule.name} : ${rule.params}`);
|
115
|
-
|
116
|
-
return;
|
117
|
-
}
|
118
|
-
});
|
119
|
-
root.walkRules(rule => {
|
120
|
-
rule.walkDecls(decl => {
|
121
|
-
const previous = decl.parent.nodes[decl.parent.nodes.indexOf(decl) - 1];
|
122
|
-
|
123
|
-
if (previous && previous.type === 'comment' && previous.text === 'prefix:ignore') {
|
124
|
-
return;
|
125
|
-
}
|
126
|
-
|
127
|
-
if (Object.keys(prefixes).includes(decl.prop) && !prefixConfig.exclude.includes(decl.prop) && prefixConfig.include && (Object.keys(prefixConfig.include).length === 0 || Object.keys(prefixConfig.include).includes(decl.prop))) {
|
128
|
-
const newPrefixes = [];
|
129
|
-
const replacements = prefixConfig.replacements && prefixConfig.replacements[decl.prop] ? prefixConfig.replacements[decl.prop] : {}; // if (!prefixes[decl.prop] && !replacements) {
|
130
|
-
// return;
|
131
|
-
// }
|
132
|
-
|
133
|
-
const mozDecl = decl.clone(); // custom value need to change
|
134
|
-
|
135
|
-
if (mozDecl.prop && prefixConfig.browsers && prefixConfig.browsers.mozilla) {
|
136
|
-
if (prefixConfig.include[decl.prop] && !prefixConfig.include[decl.prop].mozilla && !prefixes[decl.prop].mozilla) {
|
137
|
-
return;
|
138
|
-
}
|
139
|
-
|
140
|
-
mozDecl.prop = replacements && replacements.mozilla ? replacements.mozilla : prefixes[decl.prop].mozilla;
|
141
|
-
|
142
|
-
if (mozDecl.prop !== undefined) {
|
143
|
-
newPrefixes.push(mozDecl);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
const chromeDecl = decl.clone(); // custom value need to change
|
148
|
-
|
149
|
-
if (chromeDecl.prop && prefixConfig.browsers && prefixConfig.browsers.chrome) {
|
150
|
-
if (prefixConfig.include[decl.prop] && !prefixConfig.include[decl.prop].chrome && !prefixes[decl.prop].chrome) {
|
151
|
-
return;
|
152
|
-
}
|
153
|
-
|
154
|
-
chromeDecl.prop = replacements && replacements.chrome ? replacements.chrome : prefixes[decl.prop].chrome;
|
155
|
-
|
156
|
-
if (chromeDecl.prop !== undefined) {
|
157
|
-
newPrefixes.push(chromeDecl);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
const operaDecl = decl.clone(); // custom value need to change
|
162
|
-
|
163
|
-
if (operaDecl.prop && prefixConfig.browsers && prefixConfig.browsers.opera) {
|
164
|
-
if (prefixConfig.include[decl.prop] && !prefixConfig.include[decl.prop].opera && !prefixes[decl.prop].opera) {
|
165
|
-
return;
|
166
|
-
}
|
167
|
-
|
168
|
-
operaDecl.prop = replacements && replacements.opera ? replacements.opera : prefixes[decl.prop].opera;
|
169
|
-
|
170
|
-
if (operaDecl.prop !== undefined) {
|
171
|
-
newPrefixes.push(operaDecl);
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
const ieDecl = decl.clone(); // custom value need to change
|
176
|
-
|
177
|
-
if (ieDecl.prop && prefixConfig.browsers && prefixConfig.browsers.ie) {
|
178
|
-
if (prefixConfig.include[decl.prop] && !prefixConfig.include[decl.prop].ie && !prefixes[decl.prop].ie) {
|
179
|
-
return;
|
180
|
-
}
|
181
|
-
|
182
|
-
ieDecl.prop = replacements && replacements.ie ? replacements.ie : prefixes[decl.prop].ie;
|
183
|
-
|
184
|
-
if (ieDecl.prop !== undefined) {
|
185
|
-
newPrefixes.push(ieDecl);
|
186
|
-
}
|
187
|
-
}
|
188
|
-
|
189
|
-
decl.parent.insertAfter(decl, newPrefixes); // console.log(`${decl.prop} : ${decl.value}`);
|
190
|
-
}
|
191
|
-
});
|
192
|
-
});
|
193
|
-
};
|
194
|
-
});
|