-
-
Notifications
You must be signed in to change notification settings - Fork 199
Closed
Labels

Description
Hi,
I have seen that it is possible to have multiple configurations in the webpack.config.js, just like magic :
Encore
.setOutputPath('web/build/')
.setPublicPath('/build')
.addEntry('app', './assets/js/main.js')
.addStyleEntry('global', './assets/css/global.scss')
.enableSassLoader()
.autoProvidejQuery()
.enableSourceMaps(!Encore.isProduction())
;
// build the first configuration
const firstConfig = Encore.getWebpackConfig();
// Reset Encore to build the second config
Encore.reset();
Encore
.setOutputPath('web/build/')
.setPublicPath('/build')
.addEntry('mobile', './assets/js/mobile.js')
.addStyleEntry('mobile', './assets/css/mobile.less')
.enableLessLoader()
.enableSourceMaps(!Encore.isProduction())
;
// build the second configuration
const secondConfig = Encore.getWebpackConfig();
// export the final configuration
module.exports = [firstConfig, secondConfig];
But I want to know if it is possible to run one config with a specific option, like
yarn run encore dev --firstConfig
Thank you for your answer