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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dependencies of config watchable #1072

Merged

Conversation

serg-plusplus
Copy link

@qntndev
Copy link

qntndev commented Aug 11, 2019

Looks like you solve the problem debated in this live session !

Please merge @adamwathan 🙏

@serg-plusplus
Copy link
Author

@adamwathan , how can I help with continuing this staff?

@adamwathan
Copy link
Member

Sorry just haven't had a chance to play with this yet! One thing I noticed looking briefly but unsure if is true, does this recursively watch dependencies?

Say I have a file like this:

const plugins = require('./plugins')

module.exports = {
  // ...
  plugins: plugins
}

And inside plugins I have this:

// plugins.js
module.exports = [
  require('./buttons'),
  require('./form-controls'),
  require('./animations'),
]

Would the buttons.js, form-controls.js, and animations.js files be watched? I think that would probably be ideal but even if not this is still better than what we have now 👍

@serg-plusplus
Copy link
Author

Yes, this recursively watches dependencies

@adamwathan
Copy link
Member

Awesome, tested it out and works great 👍 Thank you!

@garand
Copy link

garand commented Feb 7, 2020

@serh11p @adamwathan This doesn't appear to be working if the required file is from an NPM package. Any ideas?

@adamwathan
Copy link
Member

That’s by design, watching the entire tree of dependencies through to node_modules makes things really, really, slow, and it’s sort of out of the ordinary to be editing files directly in node_modules. What’s your use case?

@garand
Copy link

garand commented Feb 10, 2020

@adamwathan Yeah, you're right... currently I'm developing a design system and separate app that consumes that design system in tandem so I'm importing the Tailwind config from the design system package (npm link'd). Of course after I finalize everything the config won't be changing, so this is working as intended, and for now I've changed my require statement to go up a directory to find the file instead of through the package. 👍

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

Successfully merging this pull request may close these issues.

None yet

4 participants