Eliav2 / react-xarrows

Draw arrows (or lines) between components in React!
https://codesandbox.io/embed/github/Eliav2/react-xarrows/tree/master/examples?fontsize=14&hidenavigation=1&theme=dark
MIT License
584 stars 75 forks source link

Update tsconfig.json #63

Closed tvildo closed 3 years ago

tvildo commented 3 years ago

change target as es5 package

Eliav2 commented 3 years ago

Why is that nececrry

tvildo commented 3 years ago

Sorry it was my mistake, We can just close this pull request.

long stroy: I was having a issue to use this module in ie11 as it is transforming ts in es2015. To fix this issues Instead I modified webpack config like this:

{
    test: /\.jsx?$/,
    exclude: function (modulePath) {
        const nodeMod = path.resolve(__dirname, 'node_modules');

        const except = [
            path.resolve(nodeMod, "react-xarrows"),
        ];

        if (modulePath.startsWith(nodeMod)) {
            if (except.some(x => modulePath.startsWith(x))) {
                console.log('transforming_module', modulePath);
                return false;
            }

            return true;
        }

        return false;
    },
    use: {
        loader: 'babel-loader',
        options: {
            presets: [
                ['@babel/preset-env', {
                    targets: {
                        "browsers": [
                            "last 2 versions",
                            "IE 11"
                        ]
                    },
                    useBuiltIns: false,
                    modules: "commonjs"
                }]
            ],
            plugins: ['@babel/plugin-transform-runtime']
        }
    }
},
tvildo commented 3 years ago

Closed as it is not required as explained above