30 lines
867 B
JavaScript
30 lines
867 B
JavaScript
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
|
|
// Le chemin sur le disque où les fichiers compilés sont stockés
|
|
.setOutputPath('public/build/')
|
|
// Le chemin public utilisé par le serveur web pour y accéder
|
|
.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(); |