0

i am creating react library. when i use that libary in my project i am facing this issue

(https://i.stack.imgur.com/HymU0.png)](https://i.stack.imgur.com/HymU0.png)

This is my webpack.config file

var path = require("path");

module.exports = {
  mode: "production",
  entry: "./tables.js",
  output: {
    // path: path.resolve("build"),
    libraryTarget: "umd",
    path: __dirname + '/dist',
    publicPath: '/',
    filename: 'index.js',
  },
  module: {
    rules: [
      {
        test: /\.jsx?$/, exclude: /node_modules/
        , use: {
          loader: 'babel-loader',
          options: {
            presets: [
              ['@babel/preset-env', { targets: "defaults" }, '@babel/preset-react'
              ]
            ],
            plugins: ['@babel/plugin-proposal-class-properties']
          }
        }

      },
      {
        test: /\.(s*)css$/,
        use: ['style-loader', 'css-loader', 'sass-loader']
      },

    ]
  },
  
  externals: {
    'react': 'react',
  }
};

i am expecting to load this chunk in my project without facing this issue

0 Answers0