webpack-encore
webpack-encore copied to clipboard
Copy files without entries?
Hi, I want to copy static files into a separate command, but I get an error when executing
No entries found! You must call addEntry() or addEntries() or addStyleEntry() or copyFiles() at least once - otherwise... there is nothing to webpack!
//config for copy static files
Encore
.setOutputPath('public/assets/')
.setPublicPath('/assetic')
.setManifestKeyPrefix('assetic/')
.disableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.addPlugin(new CopyWebpackPlugin({
patterns: [
{ from: './assets/sites', to: '../sites', info: { minimized: true } },
{ from: './assets/bundles', to: '../bundles', info: { minimized: true } },
{ from: './assets/vendor', to: 'vendor', info: { minimized: true } },
]
}))
;
const copyStaticConfig = Encore.getWebpackConfig();
copyStaticConfig.name = 'copyStaticConfig';
Encore.reset();
module.exports = [copyStaticConfig];
If use copyFiles() how to set multiply path and not minimized? https://symfonycasts.com/screencast/webpack-encore/copy-files
See Plugin docu https://webpack.js.org/plugins/copy-webpack-plugin/#skip-running-javascript-files-through-a-minimizer
For the Error i will Open a pull request in the next days i Run into the Same Problem 😁