Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: accept use with addPlugin only #1247

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

gimler
Copy link
Contributor

@gimler gimler commented Jan 7, 2024

i have a multi config setup. In one of my configs i only call addPlugin().

const path = require('node:path');
const fileName = process.env.COPY_FILE_NAME || false;
let copyConfig = {};
if (fileName) {
  copyConfig = {
    from: `${fileName}`,
    to: `${path.dirname(path.relative(path.resolve(__dirname, 'picture'), fileName))}/[name].[contenthash:8][ext]`,
  }
} else {
  copyConfig = {
    from: './picture',
    to: '[path][name].[contenthash:8][ext]'
  }

  Encore.cleanupOutputBeforeBuild()
};

const CopyPlugin = require('copy-webpack-plugin');
Encore
...
  .addPlugin(
      new CopyPlugin({
        patterns: [copyConfig],
      })
    )
...

this config only copy files optional only a specific ;)

Actually only use addPlugin() is not supported. I change the code and add test for the scenario.

releated #1140

@gimler
Copy link
Contributor Author

gimler commented Jan 16, 2024

@weaverryan can you take a look please?

@weaverryan
Copy link
Member

Thanks Gordon!

@weaverryan weaverryan merged commit cc30762 into symfony:main Jan 22, 2024
16 of 28 checks passed
@gimler gimler deleted the bug/only_addplugin branch February 28, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants