'Issue with integrating cortex-js/compute machine in react application

I am trying to use compute machine provided by the cortexjs. https://cortexjs.io/compute-engine

I saved this dependency using npm i @cortex-js/compute-engine

After I ran npm start, I am getting this error: ERROR in ./node_modules/@cortex-js/compute-engine/dist/compute-engine.min.js 2:1360 Module parse failed: Unexpected token (2:1360) You may need an appropriate loader to handle this file type.

Following is my webpack file:

var webpack = require('webpack');
const HtmlWebPackPlugin = require("html-webpack-plugin");
var path = require('path');

module.exports = {
  // output: {
  //   path: path.resolve(__dirname, 'dist'),
  //   filename: 'main.js',
  //   publicPath: '/'
  // },
  mode : 'production',
  devServer: {
    historyApiFallback: true,
  },
  devtool: "source-map",
  module: {
    rules: [
      {
       test: /\.(png|jpg|woff|woff2|gif)$/i,
       use: [
         {
           loader: 'url-loader',
           options: {
             limit: 8192
           }
         }
       ]
     },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      },
      {
        test: /\.html$/,
        use: [
          {
            loader: "html-loader"
          }
        ]
      },
      {
  test: /\.css$/,
  loader: 'style-loader'
},
{
      test: /\.css$/,
      loader: 'css-loader',
      options: {
        import: true,
      },
    }
    ]
  },
  plugins: [
    new HtmlWebPackPlugin({
      template: "./src/index.html",
      filename: "./index.html"
    })
  ]
};

Please can someone suggest which loader should I add to webpack.config file to make this work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source