@zohodesk/react-cli 1.0.3-exp.3 → 1.0.3-exp.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -106,7 +106,6 @@ function watchHandler(fromPath, toPath) {
|
|
106
106
|
// strictMode
|
107
107
|
|
108
108
|
} = data;
|
109
|
-
const oldCode = rootOriginal.toString();
|
110
109
|
rootOriginal.walkRules(rule => {
|
111
110
|
rule.walkDecls(decl => {
|
112
111
|
decl.value.split(' ').forEach(val => {
|
@@ -131,24 +130,15 @@ function watchHandler(fromPath, toPath) {
|
|
131
130
|
return;
|
132
131
|
}
|
133
132
|
|
134
|
-
const convertedCode = variableConverter(rootOriginal, variables, settingsObject).toString();
|
133
|
+
const convertedCode = variableConverter(rootOriginal, variables, settingsObject).toString(); // if (convertedCode.trim() !== '') {
|
134
|
+
// fs.writeFileSync(fromPath, convertedCode);
|
135
|
+
// }
|
136
|
+
// console.log(convertedCode);
|
135
137
|
|
136
|
-
|
137
|
-
|
138
|
-
} // console.log(convertedCode);
|
139
|
-
|
140
|
-
|
141
|
-
postcss([postcssVariableConvertor(cssVariableOptions)]).process(css, {
|
142
|
-
from: fromPath,
|
143
|
-
to: toPath
|
138
|
+
postcss([postcssVariableConvertor(cssVariableOptions)]).process(convertedCode, {
|
139
|
+
from: undefined
|
144
140
|
}).then(result => {
|
145
141
|
fs.writeFileSync(toPath, result.css);
|
146
|
-
|
147
|
-
if (result.map) {
|
148
|
-
fs.writeFileSync(`${toPath}.map`, result.map);
|
149
|
-
}
|
150
|
-
}).then(() => {
|
151
|
-
fs.writeFileSync(fromPath, oldCode);
|
152
142
|
}); // console.log(variableOptions);
|
153
143
|
}
|
154
144
|
|