make sure that tailwind has access to the AST

It's better to run this plugin first so Tailwind can operate on a single set of CSS after the imports have been inlined, like mentioned in the postcss-import documentation:
> This plugin should probably be used as the first plugin of your list. This way, other plugins will work on the AST as if there were only a single file to process, and will probably work as you can expect.
If you tried to @import any CSS file that was using Tailwind features like @responsive, this setup wouldn't work because Tailwind wouldn't see that code, it would only see an @import line. You want all of the imports inlined before running any other plugins.
This commit is contained in:
dotnetCarpenter 2017-11-13 19:18:22 +01:00
parent 292c02eb64
commit f75a7e3dee

View File

@ -1,7 +1,7 @@
module.exports = { module.exports = {
plugins: [ plugins: [
require('tailwindcss')('./tailwind.js'),
require('postcss-import'), require('postcss-import'),
require('tailwindcss')('./tailwind.js'),
require('autoprefixer') require('autoprefixer')
] ]
} }