fix importmap for assetmapper 6.4 (#1245)

* fix default importmap

* fix paths and add entrypoint comment

* remove adding stylesheet line in base.html.twig

* Update symfony/asset-mapper/6.4/manifest.json

Co-authored-by: Ryan Weaver <weaverryan+github@gmail.com>

* ignore assets/vendor

* revert to 6.3

---------

Co-authored-by: Ryan Weaver <weaverryan+github@gmail.com>
This commit is contained in:
Tac Tacelosky
2023-10-17 15:15:18 +02:00
committed by GitHub
co-authored by Ryan Weaver
parent 285a9abc99
commit dc52796fba
5 changed files with 64 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
/*
* Welcome to your app's main JavaScript file!
*
* This file will be included onto the page via the importmap() Twig function,
* which should already be in your base.html.twig.
*/
import './styles/app.css'
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉')
@@ -0,0 +1,3 @@
body {
background-color: skyblue;
}
@@ -0,0 +1,5 @@
framework:
asset_mapper:
# The paths to make available to the asset mapper.
paths:
- assets/
+21
View File
@@ -0,0 +1,21 @@
<?php
/**
* Returns the import map for this application.
*
* - "path" is a path inside the asset mapper system. Use the
* "debug:asset-map" command to see the full list of paths.
*
* - "entrypoint" (JavaScript only) set to true for any module that will
* be used as an "entrypoint" (and passed to the importmap() Twig function).
*
* The "importmap:require" command can be used to add new entries to this file.
*
* This file has been auto-generated by the importmap commands.
*/
return [
'app' => [
'path' => './assets/app.js',
'entrypoint' => true,
],
];
+26
View File
@@ -0,0 +1,26 @@
{
"copy-from-recipe": {
"assets/": "assets/",
"config/": "%CONFIG_DIR%/",
"importmap.php": "importmap.php"
},
"aliases": ["asset-mapper", "importmap"],
"gitignore": [
"/%PUBLIC_DIR%/assets/",
"/assets/vendor"
],
"add-lines": [
{
"file": "templates/base.html.twig",
"content": " {{ importmap('app') }}",
"position": "after_target",
"target": "{% block javascripts %}",
"warn_if_missing": true
}
],
"conflict": {
"symfony/framework-bundle": "<6.3",
"symfony/twig-bundle": "<6.3",
"symfony/flex": "<1.20.0 || >=2.0.0,<2.3.0"
}
}