Skip to content

Commit 4d1207a

Browse files
authored
[Feature] [MST] Improve webpack integration (#15) (#16)
* [Feature] [MST] Improve webpack integration * [Feature] [MST] Add default start page
1 parent c1e39af commit 4d1207a

File tree

12 files changed

+190
-5
lines changed

12 files changed

+190
-5
lines changed

assets/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
// any CSS you import will output into a single css file (app.css in this case)
99
import './styles/app.css';
10+
import './styles/global.scss';
11+
12+
require('bootstrap');
1013

1114
// start the Stimulus application
1215
import './bootstrap';

assets/backend.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Welcome to your app's main JavaScript file!
3+
*
4+
* We recommend including the built version of this JavaScript file
5+
* (and its CSS file) in your base layout (base.html.twig).
6+
*/
7+
8+
// any CSS you import will output into a single css file (app.css in this case)
9+
import './styles/backend.css';
10+
11+
// start the Stimulus application
12+
import './bootstrap';

assets/styles/backend.css

Whitespace-only changes.

assets/styles/global.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import "~bootstrap/scss/bootstrap";

package-lock.json

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"@symfony/stimulus-bridge": "^3.0.0",
55
"@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/Resources/assets",
66
"@symfony/webpack-encore": "^1.7.0",
7+
"bootstrap": "^5.1.3",
78
"chart.js": "^3.4.1",
89
"core-js": "^3.0.0",
910
"regenerator-runtime": "^0.13.2",
11+
"sass": "^1.49.8",
12+
"sass-loader": "^12.6.0",
1013
"webpack-notifier": "^1.6.0"
1114
},
1215
"license": "UNLICENSED",

public/img/favicon.png

-3.21 KB
Loading

public/img/logo.png

4.78 KB
Loading

src/Backend/Dashboard/Communication/Controller/DashboardController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace App\Backend\Dashboard\Communication\Controller;
99

10+
use EasyCorp\Bundle\EasyAdminBundle\Config\Assets;
1011
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
1112
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
1213
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
@@ -39,4 +40,13 @@ public function configureMenuItems(): iterable
3940
{
4041
yield MenuItem::linktoDashboard('Dashboard', 'fa fa-home');
4142
}
43+
44+
/**
45+
* @return Assets
46+
*/
47+
public function configureAssets(): Assets
48+
{
49+
return Assets::new()
50+
->addWebpackEncoreEntry('backend');
51+
}
4252
}

src/Backend/Dashboard/Presentation/index.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
{% block content_title %}Dashboard{% endblock %}
66

77
{% block main %}
8-
{{ encore_entry_link_tags('app') }}
9-
{{ encore_entry_script_tags('app') }}
8+
<p>Hello Backend!</p>
109
{% endblock %}

0 commit comments

Comments
 (0)