Checking Generated Typings of CSS Modules
15 Apr 2020 - Open Source, TypeScript, CI
As an extensive user of the typings-for-css-modules-loader Webpack loader to generate TypeScript typings from SCSS files I often missed a way to verify them in CI pipelines.
Context
When using this loader it is recommended to commit the generated typings as the Webpack process is independent of the TypeScript compiler process: sometimes, due to a race condition, TypeScript may not find the typings.
Solution
With this PR we now have the verifyOnly
option to ask the loader to not emit any typings but instead to validate them: if the typings stored in the repository
are missing or have changed then an error is emitted.
Usage:
|
|
Don’t forget to upgrade if necessary: the verifyOnly
option has been released with the version 2.1.1
, which is
already available on npm.
Thank you a lot to the maintainer of the repository for the review & its reactivity!