damorej-at-theinstitutes / webpack-concat-files-plugin

Concatenate and transform files using Webpack
MIT License
10 stars 8 forks source link

ERROR in Conflict: Multiple assets emit different content to the same filename #36

Open jlariza opened 3 years ago

jlariza commented 3 years ago

Good day,

We are using this module to concat some JS. However, when compiling, we get several ERROR in Conflict: Multiple assets emit different content to the same filename for each output file.

This is the configuration we are using

    new WebpackConcatPlugin({
      bundles: [
        {
          dest: './assets/dist/plugins.js',
          src: './assets/src/scripts/plugins/**/*.js',
        },
        {
          dest: './assets/dist/tableau.js',
          src: './assets/src/scripts/tableau/**/*.js',
        },
        {
          dest: './assets/dist/destination-architect.js',
          src: './assets/src/scripts/destination-architect/**/*.js',
        },
        {
          dest: './assets/dist/contact-form.js',
          src: './assets/src/scripts/contact-form/**/*.js',
        },
      ],
    }),

Are we missing something?

Thank you,

domhhv commented 3 years ago

We've been facing the same issues – webpack exits with code 1 because of this (when running in production mode)

MasterTheRock commented 3 years ago

I have the same issue with Webpack 5 and I fix the problem with adding the option allowOptimization to true

domhhv commented 3 years ago

@MasterTheRock Didn't help me...

MasterTheRock commented 3 years ago

I don't know why, but I add new bundle and some of this bundle generate ERROR in Conflict: Multiple assets emit different content to the same filename, but not all :/

MasterTheRock commented 3 years ago

I delete all function one by one in my file and I found one function that create the error, but why? I don't know! This is my function that cause the issue :

function handleKeyPress(event) {
  const key = event.which ?? event.keyCode;

  if(key === 46) {
    const text = event.currentTarget.value;

    if(text.indexOf('.') === -1) {
      return true;
    }
  }

  if(key > 31 && (key < 48 || key > 57)) {
    return false;
  }

  return true;
}

This is my function that cause no issue :

function handleKeyPress(event) {
  const key = event.which ?? event.keyCode;

  if(key === 46 && event.currentTarget.value.indexOf('.') === -1) {
    return true;
  }

  if(key > 31 && (key < 48 || key > 57)) {
    return false;
  }

  return true;
}
instagibb commented 2 years ago

I ran into this issue as well. We found that it was caused by the MiniCssExtractPlugin (or at least in our case it was). Updating this plugin from 1.6.0 (April 2021) to 2.4.5 (November 2021) and this problem was gone