Skip to content
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

Not working with TSX + {"jsx": "react"} #58

Open
eni9889 opened this issue Mar 11, 2022 · 1 comment
Open

Not working with TSX + {"jsx": "react"} #58

eni9889 opened this issue Mar 11, 2022 · 1 comment

Comments

@eni9889
Copy link

eni9889 commented Mar 11, 2022

I need to use this with a TS project and it will not work. When I change to

jsx:preserve

I get errors. Any solitons?

@gustelle
Copy link

Hello,

I have a similar issue, my webpack is [email protected]

The data-v get generated without going through webpack, but as soon as I add a webpack config to craco it the data-v are not generated any more, here is my craco.config.js

const path = require("path");

module.exports = {
    plugins: [
        {
            plugin: require('craco-plugin-scoped-css'),
        }
    ],
    webpack: {
        configure: {
            mode: 'development',
            entry: "./src/index.tsx",
            devtool: 'source-map',
            resolve: {
                /**
                 * important to look-up for JSON files, because the locales are stored in JSON
                 */
                extensions: [".js", ".jsx", "ts", "tsx", ".json"],
            },
            output: {
                path: path.resolve(__dirname, "public"),
                filename: "app.js",
            },
            module: {
                /** "rules"
                 * use the ts-loader to transform tsx or ts files before adding it to the bundle. 
                 */
                rules: [
                    {
                        test: /\.(ts|tsx)$/, //kind of file extension this rule should look for and apply in test
                        exclude: /node_modules/, //folder to be excluded
                        use: "ts-loader", //loader which we are going to use
                    }
                ],
            },
        }
    }
}

Am I missing something ?

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants