Open danielstreit opened 3 years ago
I encountered similar problem
tsdx-formatjs-repro/example/index.tsx: Invalid Version: undefined
see the issue resolve this.
and the big problem occurs.
$ tsdx build @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to
true
, as the next major version will default 🚨 /Users/.../tsdx-formatjs-repro/dist/testintl.esm.js: /Users/.../tsdx-formatjs-repro/dist/testintl.esm.js: message.trim is not a function
I'd like to add translations to my library using react-intl. There is an associated babel plugin,
babel-plugin-formatjs
, that transforms and compiles the messages to be translated.To Reproduce
Git Repro URL
https://github.com/danielstreit/tsdx-formatjs-repro
Reproducible Steps/Repo
Steps to reproduce the behavior:
npx tsdx create mylib
yarn add react-intl babel-plugin-formatjs
yarn build
Expected behavior
Messages in the build output should:
defaultMessages
should be compileddescription
should be omittedSee build output here: https://github.com/danielstreit/tsdx-formatjs-repro/blob/main/dist/testintl.esm.js.
intl.formatMessage
is transformed as expectedFormattedMessage
is not transformed at allSuggested solution(s)
I'm not sure. I'm having trouble determining the root cause. Any help in identifying or debugging it would be greatly appreciated
Your environment