-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
The CopyWebpackPlugin is undefined #331
Comments
Hi @robinvdvleuten , The preact cli does not use that webpack plugin , if you need it you may need to add it by pushing into the Here you can see the CLI's webpack : https://github.com/developit/preact-cli/blob/master/src/lib/webpack/webpack-base-config.js |
@SaraVieira but there is one in https://github.com/developit/preact-cli/blob/master/src/lib/webpack/webpack-client-config.js#L76 Aren't these merged when building with webpack? |
Ah - custom config is actually run twice - once against the SSR/prerender configuration, and once against the client configuration. CopyWebpackPlugin is only in the client configuration, so you'll want to existence-test for it when trying to pull it out of the config: export default function (config, env, helpers) {
let copyPlugin = helpers.getPluginsByName(config, 'CopyWebpackPlugin');
if (copyPlugin) {
// ..
}
} |
I also managed to solve it by just adding the plugin myself within a custom config file 👍 |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When I call the
getPlugins
helper, an array of all used plugins is returned. But it doesn't seem to contain theCopyWebpackPlugin
.If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
I expect an array containing the
CopyWebpackPlugin
.Please mention other relevant information.
The text was updated successfully, but these errors were encountered: