Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve config file relative to the file being transformed instead of cwd #6517

Open
mischnic opened this issue Dec 14, 2021 · 3 comments
Open

Resolve config file relative to the file being transformed instead of cwd #6517

mischnic opened this issue Dec 14, 2021 · 3 comments

Comments

@mischnic
Copy link

@mischnic mischnic commented Dec 14, 2021

What version of Tailwind CSS are you using?

v3.0.2

What build tool (or framework if it abstracts the build tool) are you using?

Parcel 2 馃憢

What version of Node.js are you using?

16

What operating system are you using?

macOS

Describe your issue

A "standard" PostCSS config like

const path = require("path");

module.exports = {
  plugins: [
      require('tailwindcss')
  ]
}

causes Tailwind to search for the config file relative to the current working directory because of this

for (const configFile of ['./tailwind.config.js', './tailwind.config.cjs']) {
try {
const configPath = path.resolve(configFile)

I think it should instead be relative to the file that's being processed. This way you could also have a single project with multiple config files for different parts.

This might have performance downsides if you currently search just once for a config.

@Serenit8

This comment was marked as spam.

@Farr69

This comment was marked as spam.

@Erin69

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@mischnic @Farr69 @Erin69 @Serenit8 and others