A babel macro for dedent
yarn add babel-plugin-macros
.babelrc
{
"plugins": ["macros"]
}
See more info in the main documentation
yarn add --dev dedent.macro
import dedent from 'dedent.macro'
dedent`
hi there
this is fine
`
This will transform out the leading spaces, just like regular Dedent usage would, but with the difference being that the dedent call will be transformed out completely during the babel process.