We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AFAIK the problem with overriding Nx's own ts-loader transformer is that it'll then no longer support Nx's build cache
Here are some examples how to merge getCustomTransformers:
The text was updated successfully, but these errors were encountered:
build cache works with following webpack config if deepkit transformer works too has to be tested
webpack-deepkit.config.js:
const typeCompiler = require('@deepkit/type-compiler'); module.exports = (config, _context) => { config.module.rules .filter((rule) => rule.loader?.includes('ts-loader')) .forEach((tsRule) => { tsRule.options.getCustomTransformers = addDeepkitTransformer(tsRule.options.getCustomTransformers) }); return config }; // this enables @deepkit/type's type compiler function addDeepkitTransformer(prevGetCustomTransformers) { return (program) => { const customTransformers = { ...(prevGetCustomTransformers ? prevGetCustomTransformers(program) : undefined) }; customTransformers.before = [ typeCompiler.transformer, ...(customTransformers.before || []) ]; customTransformers.afterDeclarations = [ typeCompiler.declarationTransformer, ...(customTransformers.afterDeclarations || []) ]; // console.log(customTransformers); return customTransformers } }
Sorry, something went wrong.
I think I managed to add the Deepkit transformer to getCustomTransformers and preserve the Nx transformer. Nx build cache works again.
No branches or pull requests
Here are some examples how to merge getCustomTransformers:
The text was updated successfully, but these errors were encountered: