Skip to content

Commit a9e9ec5

Browse files
committed
DevFront - ajout de symfony/asset-mapper
1 parent 026b13a commit a9e9ec5

9 files changed

Lines changed: 265 additions & 95 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ js_dist
5151
/compose.override.yml
5252
/composer.phar
5353
/data
54-
54+
/assets/vendor/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
framework:
2+
asset_mapper:
3+
# The paths to make available to the asset mapper.
4+
paths:
5+
- '%kernel.project_dir%/../assets/'
6+
importmap_path: '%kernel.project_dir%/../importmap.php'
7+
missing_import_mode: strict
8+
9+
when@prod:
10+
framework:
11+
asset_mapper:
12+
missing_import_mode: warn

‎assets/app.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import './styles/app.css';
2+

‎assets/styles/app.css‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
body {
2+
background-color: #ddd;
3+
color: #3e3d40;
4+
font-family: helvetica,arial,sans-serif;
5+
font-size: 1.3em;
6+
line-height: 1.54;
7+
}

‎composer.json‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"setasign/tfpdf": "^1.33",
4646
"smarty/smarty": "^5.4",
4747
"symfony/asset": "7.3.*",
48+
"symfony/asset-mapper": "7.3.*",
4849
"symfony/clock": "7.3.*",
4950
"symfony/console": "7.3.*",
5051
"symfony/expression-language": "7.3.*",
@@ -60,6 +61,7 @@
6061
"symfony/security-bundle": "7.3.*",
6162
"symfony/string": "7.3.*",
6263
"symfony/translation": "7.3.*",
64+
"symfony/twig-pack": "^1.0",
6365
"symfony/validator": "7.3.*",
6466
"symfony/yaml": "7.3.*",
6567
"twig/extra-bundle": "^3.21",
@@ -72,11 +74,13 @@
7274
"scripts": {
7375
"post-install-cmd": [
7476
"@php bin/console cache:clear --no-warmup",
75-
"@php bin/console assets:install --relative htdocs"
77+
"@php bin/console assets:install --relative htdocs",
78+
"@php bin/console importmap:install"
7679
],
7780
"post-update-cmd": [
7881
"@php bin/console cache:clear --no-warmup",
79-
"@php bin/console assets:install --relative htdocs"
82+
"@php bin/console assets:install --relative htdocs",
83+
"@php bin/console importmap:install"
8084
]
8185
},
8286
"config": {

0 commit comments

Comments
 (0)