5

I have an issue with my generated webpack bundle on IE11. I have check the bundle and it is due to some arrow functions.

It come from a node_module package : lite-id

My webpack config :

var config = {
    devtool: 'source-map', 
    entry: ["babel-polyfill", APP_DIR + '/index.js'],
    output: {
        path: BUILD_DIR,
        filename: 'BundleNodeJs.js',
        libraryTarget: "umd",    
    },
    resolve: {
        extensions: ['.js', '.jsx', '.css', '.scss'],
        symlinks: false
    },
    [...]
    module: {
        rules: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules|bower_components/,
                loader: "babel-loader",
                options: {
                    presets: ['env', 'react', 'stage-2']
                }
            },
        ]
    }
};

What is the good way to transpile arrow functions to regular functions in this node module ?

k4st0r42
  • 1,174
  • 1
  • 15
  • 29

1 Answers1

0

If you know for sure lite-id is the culprint you could try to exclude node_modules except lite-id ex: exclude: /node_modules(?!\/lite-id)/ In doing so you will transpile lite-id along with your code - I think.

Hope it helps!

bamse
  • 4,243
  • 18
  • 25