-
-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Including full usage example #1015
Conversation
ThomasLandauer
commented
Oct 27, 2021
Q | A |
---|---|
License | MIT |
Doc issue/PR | n/a |
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. symfony/webpack-encore-bundle1.0 vs 1.6diff --git a/symfony/webpack-encore-bundle/1.6/config/packages/test/webpack_encore.yaml b/symfony/webpack-encore-bundle/1.6/config/packages/test/webpack_encore.yaml
new file mode 100644
index 0000000..02a7651
--- /dev/null
+++ b/symfony/webpack-encore-bundle/1.6/config/packages/test/webpack_encore.yaml
@@ -0,0 +1,2 @@
+#webpack_encore:
+# strict_mode: false
diff --git a/symfony/webpack-encore-bundle/1.0/config/packages/webpack_encore.yaml b/symfony/webpack-encore-bundle/1.6/config/packages/webpack_encore.yaml
index ce02f6b..a1335c5 100644
--- a/symfony/webpack-encore-bundle/1.0/config/packages/webpack_encore.yaml
+++ b/symfony/webpack-encore-bundle/1.6/config/packages/webpack_encore.yaml
@@ -1,14 +1,25 @@
webpack_encore:
- # The path where Encore is building the assets.
- # This should match Encore.setOutputPath() in webpack.config.js.
+ # The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
- # if using Encore.enableIntegrityHashes() specify the crossorigin attribute value (default: false, or use 'anonymous' or 'use-credentials')
+ # If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'
- # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes).
- # To enable caching for the production environment, creating a webpack_encore.yaml in the config/packages/prod directory with this value set to true
- # Available in version 1.2
- #cache: false
+ # Preload all rendered script and link tags automatically via the HTTP/2 Link header
+ # preload: true
+
+ # Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
+ # strict_mode: false
+
+ # If you have multiple builds:
+ # builds:
+ # pass "frontend" as the 3rg arg to the Twig functions
+ # {{ encore_entry_script_tags('entry1', null, 'frontend') }}
+
+ # frontend: '%kernel.project_dir%/public/frontend/build'
+
+ # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
+ # Put in config/packages/prod/webpack_encore.yaml
+ # cache: true 1.6 vs 1.9diff --git a/symfony/webpack-encore-bundle/1.6/assets/controllers/hello_controller.js b/symfony/webpack-encore-bundle/1.9/assets/controllers/hello_controller.js
index 8c79f65..47592ef 100644
--- a/symfony/webpack-encore-bundle/1.6/assets/controllers/hello_controller.js
+++ b/symfony/webpack-encore-bundle/1.9/assets/controllers/hello_controller.js
@@ -3,8 +3,9 @@ import { Controller } from 'stimulus';
/*
* This is an example Stimulus controller!
*
- * Any element with a data-controller="hello" attribute will cause
- * this controller to be executed. The name "hello" comes from the filename:
+ * Any HTML element with a data-controller="hello" attribute will cause this controller to be executed. Example:
+ * <div data-controller="hello"></div>
+ * The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
diff --git a/symfony/webpack-encore-bundle/1.6/config/packages/webpack_encore.yaml b/symfony/webpack-encore-bundle/1.9/config/packages/webpack_encore.yaml
index a1335c5..fa2e39d 100644
--- a/symfony/webpack-encore-bundle/1.6/config/packages/webpack_encore.yaml
+++ b/symfony/webpack-encore-bundle/1.9/config/packages/webpack_encore.yaml
@@ -4,6 +4,16 @@ webpack_encore:
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false
+ # Set attributes that will be rendered on all script and link tags
+ script_attributes:
+ defer: true
+ # Uncomment (also under link_attributes) if using Turbo Drive
+ # https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change
+ # 'data-turbo-track': reload
+ # link_attributes:
+ # Uncomment if using Turbo Drive
+ # 'data-turbo-track': reload
+
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'
diff --git a/symfony/webpack-encore-bundle/1.9/post-install.txt b/symfony/webpack-encore-bundle/1.9/post-install.txt
new file mode 100644
index 0000000..735ed3e
--- /dev/null
+++ b/symfony/webpack-encore-bundle/1.9/post-install.txt
@@ -0,0 +1,5 @@
+ * Install Yarn and run yarn install
+
+ * Uncomment the Twig helpers in templates/base.html.twig
+
+ * Start the development server: yarn encore dev-server |
Closing here, since it's now included in #1022 |