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
Having trouble using ts-transformer in webpack build #2110
Comments
@arawden thanks for reporting the issue. While we are looking into it, you can use the babel plugin to unblock yourself: module.exports = {
mode: "development",
entry: {
bundle: "./src/index.tsx"
},
devtool: false,
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-react',
'@babel/preset-typescript'
],
plugins: [
[
"react-intl",
{
"extractFromFormatMessageCall": true,
"idInterpolationPattern": "[sha512:contenthash:base64:6]",
"ast": true
}
]
]
}
}
],
exclude: /node_modules/
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
output: {
filename: "[name].js"
}
}; Note that you might want to run the type checking separately since Babel doesn't do that for you. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ok looks like |
I ran into the same issue, I think. One of the core causes was that Could I suggest adding the Happy to contribute to the docs myself, but the above proposal means changing functionality too. |
@unframework any contribution is welcome :) |
Which package?
@formatjs/ts-transformer
Describe the bug
I have an application in which I am currently explicitly setting IDs. My workflow looks like:
FormattedMessage
component to my codebaseformatjs
CLIFormattedMessage
componentI am trying to eliminate step 4 by using the
ts-transformer
tooling within my webpack file as described hereHowever, after following the documentation, upon loading of the component, I get an error that an ID must be provided to format a message, and the entire application crashes.
I've created a sandbox to try to recreate the problem.
To Reproduce
Steps to reproduce the behavior:
ts-transformer
ints-loader
Expected behavior
The build system injects the IDs into the compiled JS output
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: