-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: support postcss.config.ts
#218
Conversation
The types should be mostly correct, but plugins & other dependencies require some upstream updates to be v8 compatiable i.e. DefinitelyTyped/DefinitelyTyped#53003 |
Thanks. Looks great. But can I also ask you to add ESM |
@ai I can do an approximation of that, but it won't be completely possible without upgrading jest and configuring module support (i.e you need to run node with I can implement the use of |
Yeap, you can update Jest and change how we run tests |
I don't think this is possible without making a breaking change, as you have to set I'm happy to explore this, but think it would be better to land support for this as is (as that matches how other libraries like |
I asked this, because I'm afraid that A few months ago, there was no way to use |
Is that a statement or a concern? My experience with My understanding is that ESM is now supported at a similar level to Node. I can confirm I've been able to create a project with |
Great news. Yeap, let’s do it this way (I will need a day to merge and release it). |
I will play with |
This allows both `module.exports =` & `export default` to be used
Awesome - let me know if there's anything I can help with :) |
src/index.js
Outdated
|
||
// Register TypeScript compiler instance | ||
try { | ||
registerer = require('ts-node').register() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call require('ts-node')
only if .ts
file as found?
I do not want to load heavy TypeScript for the projects with .js
configs, but with ts-node
in the system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have a look, but this doesn't actually load the heavy side of the TypeScript compiler until it's actually needed, making it a very cheap call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that we are calling require('ts-node').register()
on any config loading?
(I may be wrong, I am not sure)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; like I said the require cost is negligible since it doesn't actually do any work (including creating the TypeScript compiler, and compiling code, which are the expensive operations) until a .ts
file is required.
However I think we might be able to move it into the loader
function.
Sorry, for the delay. I am back to review the PR. |
LGTM. Hope to merge and release it tomorrow (sorry, I am moving from one country to another, don’t have a lot of time for open source this month). |
Thanks. Released in 3.1. |
Notable Changes
This lands support for
postcss.config.ts
🎉Commit Message Summary (CHANGELOG)
Type
SemVer
Issues
Checklist