Skip to content

Commit b41f7d8

Browse files
committed
feat(webpack): Integrate Symfony Webpack Encore for asset management and update dependencies
1 parent e442524 commit b41f7d8

10 files changed

Lines changed: 5757 additions & 2 deletions

File tree

examples/dotcms-symfony/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@
2323
/public/assets/
2424
/assets/vendor/
2525
###< symfony/asset-mapper ###
26+
27+
###> symfony/webpack-encore-bundle ###
28+
/node_modules/
29+
/public/build/
30+
npm-debug.log
31+
yarn-error.log
32+
###< symfony/webpack-encore-bundle ###

examples/dotcms-symfony/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"minimum-stability": "stable",
55
"prefer-stable": true,
66
"require": {
7-
"dotcms/php-sdk": "^1.0.1",
87
"php": ">=8.2",
98
"ext-ctype": "*",
109
"ext-iconv": "*",
1110
"doctrine/dbal": "^3.9.4",
1211
"doctrine/doctrine-bundle": "^2.14.0",
1312
"doctrine/doctrine-migrations-bundle": "^3.4.2",
1413
"doctrine/orm": "^3.3.3",
14+
"dotcms/php-sdk": "^1.0.1",
1515
"phpdocumentor/reflection-docblock": "^5.6.2",
1616
"phpstan/phpdoc-parser": "^2.1",
1717
"symfony/asset": "7.2.*",
@@ -42,6 +42,7 @@
4242
"symfony/ux-turbo": "^2.26.1",
4343
"symfony/validator": "7.2.*",
4444
"symfony/web-link": "7.2.*",
45+
"symfony/webpack-encore-bundle": "^2.2",
4546
"symfony/yaml": "7.2.*",
4647
"twig/extra-bundle": "^2.12|^3.21",
4748
"twig/twig": "^2.12|^3.21.1"

examples/dotcms-symfony/composer.lock

Lines changed: 73 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dotcms-symfony/config/bundles.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
1414
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
1515
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
16+
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
1617
];
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
webpack_encore:
2+
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
3+
output_path: '%kernel.project_dir%/public/build'
4+
# If multiple builds are defined (as shown below), you can disable the default build:
5+
# output_path: false
6+
7+
# Set attributes that will be rendered on all script and link tags
8+
script_attributes:
9+
defer: true
10+
# Uncomment (also under link_attributes) if using Turbo Drive
11+
# https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change
12+
# 'data-turbo-track': reload
13+
# link_attributes:
14+
# Uncomment if using Turbo Drive
15+
# 'data-turbo-track': reload
16+
17+
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
18+
# crossorigin: 'anonymous'
19+
20+
# Preload all rendered script and link tags automatically via the HTTP/2 Link header
21+
# preload: true
22+
23+
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
24+
# strict_mode: false
25+
26+
# If you have multiple builds:
27+
# builds:
28+
# frontend: '%kernel.project_dir%/public/frontend/build'
29+
30+
# pass the build name as the 3rd argument to the Twig functions
31+
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
32+
33+
framework:
34+
assets:
35+
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
36+
37+
#when@prod:
38+
# webpack_encore:
39+
# # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
40+
# # Available in version 1.2
41+
# cache: true
42+
43+
#when@test:
44+
# webpack_encore:
45+
# strict_mode: false

0 commit comments

Comments
 (0)