webpack-encore icon indicating copy to clipboard operation
webpack-encore copied to clipboard

Copy files without entries?

Open CapInSpase opened this issue 3 years ago • 2 comments

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

CapInSpase avatar Jul 28 '22 17:07 CapInSpase

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 😁

gimler avatar Jan 05 '24 11:01 gimler