diff --git a/core/package.json b/core/package.json
index e06958b4ce..5aa7f6025b 100644
--- a/core/package.json
+++ b/core/package.json
@@ -107,6 +107,5 @@
     "last 1 ChromeAndroid version",
     "last 1 Samsung version",
     "Firefox ESR"
-  ],
-  "dependencies": {}
+  ]
 }
diff --git a/core/scripts/css/compile.js b/core/scripts/css/compile.js
index fe52555a77..1d984f05cd 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,
diff --git a/core/scripts/css/remove-unwanted-comments.js b/core/scripts/css/remove-unwanted-comments.js
new file mode 100644
index 0000000000..bedbb34797
--- /dev/null
+++ b/core/scripts/css/remove-unwanted-comments.js
@@ -0,0 +1,14 @@
+// On import, remove the comments, so they don't appear as useless comments at the top of the autogenerated css files.
+module.exports = opts => {
+  return {
+    postcssPlugin: 'remove-unwanted-comments',
+    Once(css) {
+      css.walk(node => {
+        if (node.type === 'comment') {
+          node.remove();
+        }
+      })
+    }
+  }
+}
+module.exports.postcss = true
