You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found an example of using different build configs, but there is a question how to get around the problem with overwriting files that were created by executing another config?
Encore
.setOutputPath('public/build/first_build/')
.setPublicPath('/build/first_build')
.addEntry('app', './assets/app.js')
.cleanupOutputBeforeBuild()
.addStyleEntry('global', './assets/styles/global.scss')
.enableSassLoader()
.autoProvidejQuery()
.enableVersioning(Encore.isProduction())
.enableSourceMaps(!Encore.isProduction())
;
// build the first configuration
const firstConfig = Encore.getWebpackConfig();
// Set a unique name for the config (needed later!)
firstConfig.name = 'firstConfig';
// reset Encore to build the second config
Encore.reset();
// define the second configuration
Encore
.setOutputPath('public/build/second_build/')
.setPublicPath('/build/second_build')
.cleanupOutputBeforeBuild()
.addEntry('mobile', './assets/mobile.js')
.addStyleEntry('mobile', './assets/styles/mobile.less')
.enableLessLoader()
.enableVersioning(Encore.isProduction())
.enableSourceMaps(!Encore.isProduction())
;
// build the second configuration
const secondConfig = Encore.getWebpackConfig();
// Set a unique name for the config (needed later!)
secondConfig.name = 'secondConfig';
// export the final configuration as an array of multiple configurations
module.exports = [firstConfig, secondConfig];
Let's say I collected the files with the first and second commands
npm run dev -- --config-name firstConfig
npm run dev -- --config-name secondConfig
and i have 2 files in /assets (global4534634.css, mobile13353.css)
but if I run again
npm run dev -- --config-name secondConfig
cleanupOutputBeforeBuild remove global4534634.css file and create new file mobile9469346.css
cleanupOutputBeforeBuild have some options for skip files or remove only files what starts with some name, fore example 'mobile*.*'?
The text was updated successfully, but these errors were encountered:
I found an example of using different build configs, but there is a question how to get around the problem with overwriting files that were created by executing another config?
https://symfony.com/doc/current/frontend/encore/advanced-config.html#defining-multiple-webpack-configurations
// define the first configuration
Let's say I collected the files with the first and second commands
npm run dev -- --config-name firstConfig
npm run dev -- --config-name secondConfig
and i have 2 files in /assets (global4534634.css, mobile13353.css)
but if I run again
npm run dev -- --config-name secondConfig
cleanupOutputBeforeBuild remove global4534634.css file and create new file mobile9469346.css
cleanupOutputBeforeBuild have some options for skip files or remove only files what starts with some name, fore example 'mobile*.*'?
The text was updated successfully, but these errors were encountered: