-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow TypeScript transpiler customization #218
Comments
Isn't this already achievable with this loader? const amaro = require('amaro');
exports.load = async function(source, context, nextLoad) {
if (context.format && context.format.includes('typescript')) {
return {
source: amaro.transformSync(source, {MY_DEFAULT_SETTINGS }),
shortCircuit: true // Skips bundled transpilation
};
}
return { source: await nextLoad(source, context) };
} |
@joyeecheung to my surprise it could be possible, I thought it wouldnt work 😮 |
I was gonna suggest the configuration file, but I see this could have possible implications. Is adding keys to My only concern about using |
btw I can tackle the loader export on amaro if that's ok :) I haven't fiddled around with loaders that much and it would be a nice opportunity to dive in and learn the specifics |
I have already created a PR nodejs/amaro#47, I need to add more testing. |
Oh nice I'll take a look :D |
Current problem:
Possible solution
A way that allows to override the default behavior of the
transformSync
.I have created this PR which makes possible to build a public api on top to customize the default behavior.
I'm open for discussion
cc @nodejs/typescript
The text was updated successfully, but these errors were encountered: