postcss / postcss-cli

CLI for postcss
Other
836 stars 93 forks source link

--output file is successfully created, but an extra index.css file is also created #357

Closed karlshea closed 3 years ago

karlshea commented 3 years ago

src/css/test.css

h1 {
  color: blue;
}

postcss.config.js

module.exports = {
  plugins: [
    require('autoprefixer'),
  ],
};

Running ./node_modules/.bin/postcss src/css/test.css --output src/css/test.output.css gets me src/css/test.output.css.

However, switching to this:

module.exports = {
  plugins: [
    require('postcss-import'),
    require('autoprefixer'),
  ],
};

or this:

const tailwindcss = require('tailwindcss'); // Note: I'm not even using it, just importing the plugin.

module.exports = {
  plugins: [
    require('autoprefixer'),
  ],
};

Gets me src/css/test.output.css AND an identical src/css/index.css.

./node_modules/.bin/postcss --version both 8.2.0 and 7.1.2, node --version is v15.0.1. autoprefixer is 9.8.6, postcss-import is 12.0.1, tailwindcss is 1.9.6.

I have no idea what might be happening. Is there any other info that I can provide?

karlshea commented 3 years ago

And you know what, of course deleting node_modules and reinstalling the packages totally fixed it.