Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!