0

I am trying to build react app into bundle.js using webpack so i am facing this issue

const path = require('path');

module.exports = {
    mode: 'development',
     devtool: 'inline-source-map',
    entry: './src/index.tsx', // Entry point of your application
    output: {
        path: path.resolve(__dirname, 'dist'), // Output directory
        filename: 'bundle.js', // Output filename
    },
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                use: 'ts-loader',
                exclude: /node_modules/,
              },
            {
                test: /\.css$/, // Add this rule to handle CSS files
                use: ['style-loader', 'css-loader'],
            },
            {
                test: /\.svg$/, // Add this rule to handle SVG files
                use: ['@svgr/webpack'],
            },
            {
                test: /\.(png|jpe?g|gif)$/i,
                use: [
                  {
                    loader: 'file-loader',
                  },
                ],
              },
              
        ],
    },
    
    resolve: {
        extensions: ['.ts', '.tsx'],
    },
};

Expecting to build bundle.js using webpack

enter image description here

Lin Du
  • 88,126
  • 95
  • 281
  • 483
  • What fixes have you tried? https://www.google.com/search?q=typescript+emitted – Jayce444 Jul 27 '23 at 06:01
  • Would you please add your package.json, tsconfig.json (if there are tsconfig.[xxx].json, too), node version – Humanoid Mk.12 Jul 27 '23 at 06:09
  • Does this https://stackoverflow.com/questions/55304436/webpack-with-typescript-getting-typescript-emitted-no-output-error answer your question? – Lin Du Jul 27 '23 at 11:29

0 Answers0