Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

221
Visualizações
Webpack generate multiple entry

I need to configure the webpack so that it compile scripts and styles in the development folder, each folder has its own name. It should transfer the compiled files to another directory with the same folder names.

I also need to copy global styles and scripts above these folders.

How to implement this? I just can't figure out how to do it

I don't need to copy, I need to сompile to another directory with the same folder names for each component

Now i have this.

const PATHS = {
    source: path.join(__dirname, 'src'),
    build: path.join(__dirname, '../web/dist'),
};

const common = merge([
    {
        entry: {
            'script': PATHS.source + '/index.js'
        },
        output: {
            path: PATHS.build,
            filename: './[name].js',
        },
        module: {},
       
    },
 //   fonts(),
    images(),
    babel()
]);

module.exports = (env, argv) => {
    let config =  common;

    if (argv.mode === 'development') {
        config = merge([
            config,
            devCSS(),
            devserver(),
        ]);
    }

    if (argv.mode === 'production') {
        config = merge([
            config,
            prodCSS()
        ]);
        if (!env) {
            config = merge([
                {
                    devtool: 'source-map',
                  /*  plugins: [
                        new CleanWebpackPlugin()
                    ],*/
                },
                config,
              //  favicon(PATHS)
            ]);
        } else if (env.update) {
            config = merge([
                config,
                {
                    watch: true,
                    watchOptions: {
                        aggregateTimeout: 300,
                        poll: 1000,
                        ignored: ['src/fonts', 'node_modules']
                    }
                }
            ]);
        }
    }
    return config;
};

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda