summaryrefslogtreecommitdiffstatshomepage
path: root/core/scripts/css/changeOrAdded.js
diff options
context:
space:
mode:
authorAlex Pott <alex.a.pott@googlemail.com>2019-10-07 15:29:07 +0100
committerAlex Pott <alex.a.pott@googlemail.com>2019-10-07 15:29:07 +0100
commit0bada7896a4b4e18fe6b1145f24620bd7dbbbc3d (patch)
tree968805a99e5deb54c613008ee41acd2983ad2a77 /core/scripts/css/changeOrAdded.js
parent2a5c62deda015ed43c5a13748d8aca6b60ff31e1 (diff)
downloaddrupal-0bada7896a4b4e18fe6b1145f24620bd7dbbbc3d.tar.gz
drupal-0bada7896a4b4e18fe6b1145f24620bd7dbbbc3d.zip
Issue #3060153 by lauriii, alexpott, finnsky, Wim Leers, xjm, catch: Use PostCSS in core, initially only for Claro
Diffstat (limited to 'core/scripts/css/changeOrAdded.js')
-rw-r--r--core/scripts/css/changeOrAdded.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/scripts/css/changeOrAdded.js b/core/scripts/css/changeOrAdded.js
new file mode 100644
index 00000000000..53c586e2e66
--- /dev/null
+++ b/core/scripts/css/changeOrAdded.js
@@ -0,0 +1,15 @@
+const fs = require('fs');
+const log = require('./log');
+const compile = require('./compile');
+
+module.exports = (filePath) => {
+ log(`'${filePath}' is being processed.`);
+ // Transform the file.
+ compile(filePath, function write(code) {
+ const fileName = filePath.slice(0, -9);
+ // Write the result to the filesystem.
+ fs.writeFile(`${fileName}.css`, code, () => {
+ log(`'${filePath}' is finished.`);
+ });
+ });
+};