Commit cc30762
committed
bug #1247 bug: accept use with addPlugin only (gimler)
This PR was merged into the main branch.
Discussion
----------
bug: accept use with addPlugin only
i have a multi config setup. In one of my configs i only call `addPlugin()`.
```js
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
Commits
-------
1bfd797 bug: accept use with addPlugin only2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| |||
0 commit comments