Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
Issue with multiple entries on webpack using name "Main"

I am very new to using react, node js, and express. To get started I followed this tutorial from the official docs.

From my understanding, I have my webpack-config.js setup with multiple entries with the intent to generate multiple js files.

module.exports = {
    devtool: 'source-map',
    mode: "development",
    entry:
    {
        app: "./src/app/app.tsx",
        test: "./src/test/test.tsx"
    },
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: './[name]-app-bundle.js'
    },
    resolve: {
        extensions: ['.Webpack.js', '.web.js', '.ts', '.js', '.jsx', '.tsx']
    },
    module: {
        rules: [
            {
                test: /\.tsx$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'ts-loader'
                }
            }
        ]
    }
}

However, when I run npm run build or node_modules\.bin\webpack ./src/app/app.tsx ./src/test/test.tsx --config webpack-config.js I get the output:

> webpack-cli ./src/app/app.tsx ./src/test/test.tsx --config webpack-config.js

asset ./main-app-bundle.js 1.09 MiB [compared for emit] (name: main) 1 related asset
runtime modules 123 bytes 1 module
modules by path ./node_modules/ 1.08 MiB
  modules by path ./node_modules/react/ 85.7 KiB
    ./node_modules/react/index.js 190 bytes [built] [code generated]
    ./node_modules/react/cjs/react.development.js 85.5 KiB [built] [code generated]
  modules by path ./node_modules/react-dom/ 1000 KiB
    ./node_modules/react-dom/index.js 1.33 KiB [built] [code generated]
    ./node_modules/react-dom/cjs/react-dom.development.js 1000 KiB [built] [code generated]
  modules by path ./node_modules/scheduler/ 17.3 KiB
    ./node_modules/scheduler/index.js 198 bytes [built] [code generated]
    ./node_modules/scheduler/cjs/scheduler.development.js 17.1 KiB [built] [code generated]
modules by path ./src/ 2.9 KiB
  ./src/app/app.tsx 2.65 KiB [built] [code generated]
  ./src/test/test.tsx 250 bytes [built] [code generated]
webpack 5.74.0 compiled successfully in 1687 ms

From what I can see, both of my entries are being named "Main" as the file generated is named "main-app-bundle.js" and this is only generating the one js file (plus the map). After hours of researching and trying fixes, I am still unsure where I am going wrong here. Can anyone point me in the right direction?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda