const Encore = require('@symfony/webpack-encore'); // Manually configure the runtime environment if not already configured yet by the "encore" command. if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); } Encore // Répertoire où les fichiers compilés seront stockés .setOutputPath('public/build/') // Chemin public utilisé par le serveur web .setPublicPath('/build') /* * ENTRY CONFIG */ .addEntry('app', './assets/app.js') .splitEntryChunks() .enableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) .enableVersioning(Encore.isProduction()) // Activer React .enableReactPreset() .enablePostCssLoader() ; module.exports = Encore.getWebpackConfig();