fix: multiple no utility classes warnings

fixes #67
This commit is contained in:
Mark Lawlor
2022-06-01 11:35:24 +10:00
parent a4d96343d5
commit b6a61ff5d8
2 changed files with 5 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ export default function rootVisitor(
content: [filename],
// If the file doesn't have any Tailwind styles, it will print a warning
// We force an empty style to prevent this
safelist: [".native-hmr-empty"],
safelist: ["native-empty"],
});
const bodyNode = path.node.body;

View File

@@ -39,7 +39,10 @@ export const nativePlugin = plugin.withOptions<NativePluginOptions | undefined>(
}
return (helpers) => {
helpers.addUtilities({ ".native-empty": {} });
// This helper is used by babel to stop warnings from being printed
// on files without styles when using Hot Module Reload.
// Because it doesn't have any styles, it will be omitted from the output
helpers.addUtilities({ ".babel-empty": {} });
color(helpers, notSupported);
space(helpers, notSupported);