-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
41 lines (28 loc) · 1.21 KB
/
webpack.config.js
File metadata and controls
41 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const Encore = require('@symfony/webpack-encore');
Encore
// le répertoire où sera compilé le code
.setOutputPath('public/build/')
// l’URL publique pour accéder aux fichiers compilés
.setPublicPath('/build')
// Ajoute ton fichier d’entrée (par défaut : app.js)
.addEntry('app', './assets/app.js')
// Active le support de Sass/SCSS si besoin :
//.enableSassLoader()
// active l’écriture des fichiers source map (utile en dev)
.enableSourceMaps(!Encore.isProduction())
// clean le dossier build avant chaque compilation
.cleanupOutputBeforeBuild()
// active versioning (ex: app.abc123.css) en production
.enableVersioning(Encore.isProduction())
// active l’intégration de Stimulus (optionnel)
//.enableStimulusBridge('./assets/controllers.json')
// active PostCSS (si besoin)
.enablePostCssLoader()
// active le support de Bootstrap 5 (optionnel si tu l’utilises)
//.enableBootstrap5()
// permet d’utiliser les fichiers importés via @ dans les SCSS
.enableSingleRuntimeChunk()
// active l’intégration de Webpack Encore avec Symfony
Encore.enableSassLoader();
;
module.exports = Encore.getWebpackConfig();