add suffix to assets entrypoints + replace link/script html tags by encore_entry twig tag

This commit is contained in:
Mathieu Jaumotte 2021-07-23 12:27:30 +02:00
parent e0dbe9cf9d
commit d20a3cf9d4
9 changed files with 45 additions and 55 deletions

View File

@ -23,7 +23,7 @@
{{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }} {{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }}
</title> </title>
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
<link rel="stylesheet" href="{{ asset('build/login.css') }}"/> {{ encore_entry_link_tags('page_login') }}
</head> </head>
<body> <body>
<div id="content"> <div id="content">
@ -42,14 +42,13 @@
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" /> <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
<br/> <br/>
<button type="submit" name="login">{{ 'Login'|trans }}</button> <button type="submit" name="login">{{ 'Login'|trans }}</button>
</form> </form>
<p class="forgot-password-link"><a href="{{ path('password_request_recover') }}">{{ 'Forgot your password ?'|trans }}</a></p> <p class="forgot-password-link"><a href="{{ path('password_request_recover') }}">{{ 'Forgot your password ?'|trans }}</a></p>
{{ include('@ChillMain/Login/_footer.html.twig') }} {{ include('@ChillMain/Login/_footer.html.twig') }}
</div> </div>
<script type="text/javascript" src="{{ asset('build/runtime.js') }}"></script> {{ encore_entry_script_tags('page_login') }}
</body> </body>
</html> </html>

View File

@ -24,11 +24,9 @@
{{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }} {{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }}
</title> </title>
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
<link rel="stylesheet" href="{{ asset('build/chill.css') }}"/> {{ encore_entry_link_tags('chill') }}
</head> </head>
<body> <body>
<header class="navigation container-fluid"> <header class="navigation container-fluid">
<div class="col-4 d-md-none parent"> <div class="col-4 d-md-none parent">
<div class="col-10 col-md-12 offset-2 logo-container"> <div class="col-10 col-md-12 offset-2 logo-container">
@ -37,12 +35,9 @@
</a> </a>
</div> </div>
</div> </div>
</header> </header>
<div id="content"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</body> </body>

View File

@ -30,9 +30,9 @@
<title>{{ installation.name }} - {% block title %}{% endblock %}</title> <title>{{ installation.name }} - {% block title %}{% endblock %}</title>
<link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon"> <link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
{{ encore_entry_link_tags('bootstrap') }} {{ encore_entry_link_tags('mod_bootstrap') }}
{{ encore_entry_link_tags('forkawesome') }} {{ encore_entry_link_tags('mod_forkawesome') }}
{{ encore_entry_link_tags('ckeditor5') }} {{ encore_entry_link_tags('mod_ckeditor5') }}
{{ encore_entry_link_tags('chill') }} {{ encore_entry_link_tags('chill') }}
{% block css%}<!-- nothing added to css -->{% endblock %} {% block css%}<!-- nothing added to css -->{% endblock %}
</head> </head>
@ -100,9 +100,9 @@
{{ include('@ChillMain/Layout/_footer.html.twig') }} {{ include('@ChillMain/Layout/_footer.html.twig') }}
{{ encore_entry_script_tags('bootstrap') }} {{ encore_entry_script_tags('mod_bootstrap') }}
{{ encore_entry_script_tags('forkawesome') }} {{ encore_entry_script_tags('mod_forkawesome') }}
{{ encore_entry_script_tags('ckeditor5') }} {{ encore_entry_script_tags('mod_ckeditor5') }}
{{ encore_entry_script_tags('chill') }} {{ encore_entry_script_tags('chill') }}
<script type="text/javascript"> <script type="text/javascript">

View File

@ -45,23 +45,19 @@ module.exports = function(encore, entries)
// Aliases are used when webpack is trying to resolve modules path // Aliases are used when webpack is trying to resolve modules path
encore.addAliases({ encore.addAliases({
ChillMainAssets: __dirname + '/Resources/public', ChillMainAssets: __dirname + '/Resources/public',
//ChillMainSass: __dirname + '/Resources/public/modules/scratch',
ShowHide: __dirname + '/Resources/public/modules/show_hide' ShowHide: __dirname + '/Resources/public/modules/show_hide'
}); });
// Add separate entrypoints // Page entrypoints
encore.addEntry('login', __dirname + '/Resources/public/modules/login_page/index.js'); encore.addEntry('page_login', __dirname + '/Resources/public/modules/login_page/index.js');
//encore.addEntry('scratch', __dirname + '/Resources/public/modules/scratch/index.js');
// Chill2 new assets // Modules entrypoints
encore.addEntry('forkawesome', __dirname + '/Resources/public/modules/forkawesome/index.js'); encore.addEntry('mod_forkawesome', __dirname + '/Resources/public/modules/forkawesome/index.js');
encore.addEntry('bootstrap', __dirname + '/Resources/public/modules/bootstrap/index.js'); encore.addEntry('mod_bootstrap', __dirname + '/Resources/public/modules/bootstrap/index.js');
// CKEditor5
buildCKEditor(encore); buildCKEditor(encore);
encore.addEntry('ckeditor5', __dirname + '/Resources/public/modules/ckeditor5/index.js'); encore.addEntry('mod_ckeditor5', __dirname + '/Resources/public/modules/ckeditor5/index.js');
// Address // Vue entrypoints
encore.addEntry('vue_address', __dirname + '/Resources/public/vuejs/Address/index.js'); encore.addEntry('vue_address', __dirname + '/Resources/public/vuejs/Address/index.js');
}; };

View File

@ -38,5 +38,5 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ encore_entry_script_tags('household_edit_metadata') }} {{ encore_entry_script_tags('page_household_edit_metadata') }}
{% endblock %} {% endblock %}

View File

@ -214,5 +214,5 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ encore_entry_script_tags('household_edit_metadata') }} {{ encore_entry_script_tags('page_household_edit_metadata') }}
{% endblock %} {% endblock %}

View File

@ -142,5 +142,5 @@
{% endblock %} {% endblock %}
{% block js %} {% block js %}
{{ encore_entry_link_tags('person') }} {{ encore_entry_link_tags('page_person') }}
{% endblock %} {% endblock %}

View File

@ -13,8 +13,8 @@ module.exports = function(encore, entries)
encore.addEntry('vue_accourse', __dirname + '/Resources/public/vuejs/AccompanyingCourse/index.js'); encore.addEntry('vue_accourse', __dirname + '/Resources/public/vuejs/AccompanyingCourse/index.js');
encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js'); encore.addEntry('vue_accourse_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js'); encore.addEntry('vue_accourse_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
encore.addEntry('vue_accourse_work_list', __dirname + '/Resources/public/modules/accompanying_course_work_list/index.js'); // why in modules ? encore.addEntry('vue_accourse_work_list', __dirname + '/Resources/public/modules/accompanying_course_work_list/index.js'); // why in modules ?
encore.addEntry('household_edit_metadata', __dirname + '/Resources/public/modules/household_edit_metadata/index.js');
encore.addEntry('person', __dirname + '/Resources/public/js/person.js'); encore.addEntry('page_household_edit_metadata', __dirname + '/Resources/public/modules/household_edit_metadata/index.js');
encore.addEntry('page_person', __dirname + '/Resources/public/js/person.js');
}; };