summaryrefslogtreecommitdiffstatshomepage
path: root/core/scripts/css/compile.js
diff options
context:
space:
mode:
authorxjm <xjm@65776.no-reply.drupal.org>2023-01-05 17:55:43 -0600
committerxjm <xjm@65776.no-reply.drupal.org>2023-01-05 17:55:43 -0600
commit83f1d40d033bae41d10d6f32964f4b67213bf83d (patch)
tree65e55a02979eadc8c4af8daa8f8fc9017c8d88c7 /core/scripts/css/compile.js
parent2d12ec2326a187e10414ec754562d83b15f7d7d4 (diff)
downloaddrupal-83f1d40d033bae41d10d6f32964f4b67213bf83d.tar.gz
drupal-83f1d40d033bae41d10d6f32964f4b67213bf83d.zip
Issue #3308872 by Spokje, xjm, longwave, bnjmnm: Address "postcss.plugin was deprecated" warning
Diffstat (limited to 'core/scripts/css/compile.js')
-rw-r--r--core/scripts/css/compile.js20
1 files changed, 4 insertions, 16 deletions
diff --git a/core/scripts/css/compile.js b/core/scripts/css/compile.js
index fe52555a777..1d984f05cdd 100644
--- a/core/scripts/css/compile.js
+++ b/core/scripts/css/compile.js
@@ -8,28 +8,16 @@ const postcssPresetEnv = require('postcss-preset-env');
// cspell:ignore pxtorem
const postcssPixelsToRem = require('postcss-pxtorem');
const stylelint = require('stylelint');
+const removeUnwantedComments = require('./remove-unwanted-comments');
module.exports = (filePath, callback) => {
// Transform the file.
fs.readFile(filePath, (err, css) => {
postcss([
postcssImport({
- plugins: [
- // On import, remove the comments from variables.pcss.css so they don't
- // appear as useless comments at the top files that import these
- // variables.
- postcss.plugin('remove-unwanted-comments-from-variables', (options) => {
- return css => {
- if (css.source.input.file.indexOf('variables.pcss.css') !== -1) {
- css.walk(node => {
- if (node.type === 'comment') {
- node.remove();
- }
- });
- }
- };
- }),
- ],
+ plugins: [
+ removeUnwantedComments,
+ ],
}),
postcssPresetEnv({
stage: 1,