From 74d12bba3bada0ef673a66159fa053a1f8038974 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:26:29 +0100 Subject: [PATCH] feat(update): apply recipes:update symfony/webpack-encore-bundle --- config/packages/assets.yaml | 3 --- config/packages/prod/webpack_encore.yaml | 4 ---- config/packages/test/webpack_encore.yaml | 2 -- config/packages/webpack_encore.yaml | 27 ++++++++++++++++++------ symfony.lock | 11 ++++------ webpack.config.js | 13 ++++++------ 6 files changed, 32 insertions(+), 28 deletions(-) delete mode 100644 config/packages/assets.yaml delete mode 100644 config/packages/prod/webpack_encore.yaml delete mode 100644 config/packages/test/webpack_encore.yaml diff --git a/config/packages/assets.yaml b/config/packages/assets.yaml deleted file mode 100644 index 051d36d..0000000 --- a/config/packages/assets.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - assets: - json_manifest_path: '%kernel.project_dir%/public/build/manifest.json' diff --git a/config/packages/prod/webpack_encore.yaml b/config/packages/prod/webpack_encore.yaml deleted file mode 100644 index d0b3ba8..0000000 --- a/config/packages/prod/webpack_encore.yaml +++ /dev/null @@ -1,4 +0,0 @@ -#webpack_encore: - # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) - # Available in version 1.2 - #cache: true diff --git a/config/packages/test/webpack_encore.yaml b/config/packages/test/webpack_encore.yaml deleted file mode 100644 index 02a7651..0000000 --- a/config/packages/test/webpack_encore.yaml +++ /dev/null @@ -1,2 +0,0 @@ -#webpack_encore: -# strict_mode: false diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index 90f1a1d..4c009ee 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -7,7 +7,12 @@ webpack_encore: # 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' @@ -20,11 +25,21 @@ webpack_encore: # 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 + # pass the build name as the 3rd argument to the Twig functions + # {{ encore_entry_script_tags('entry1', null, 'frontend') }} + +framework: + assets: + json_manifest_path: '%kernel.project_dir%/public/build/manifest.json' + +#when@prod: +# webpack_encore: +# # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) +# # Available in version 1.2 +# cache: true + +#when@test: +# webpack_encore: +# strict_mode: false diff --git a/symfony.lock b/symfony.lock index cc7714a..8c98b81 100644 --- a/symfony.lock +++ b/symfony.lock @@ -648,12 +648,12 @@ ] }, "symfony/webpack-encore-bundle": { - "version": "1.9", + "version": "1.16", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.9", - "ref": "9399a0bfc6ee7a0c019f952bca46d6a6045dd451" + "branch": "main", + "version": "1.10", + "ref": "f8fc53f1942f76679e9ee3c25fd44865355707b5" }, "files": [ "assets/app.js", @@ -661,9 +661,6 @@ "assets/controllers.json", "assets/controllers/hello_controller.js", "assets/styles/app.css", - "config/packages/assets.yaml", - "config/packages/prod/webpack_encore.yaml", - "config/packages/test/webpack_encore.yaml", "config/packages/webpack_encore.yaml", "package.json", "webpack.config.js" diff --git a/webpack.config.js b/webpack.config.js index a61b3a7..ef2fac8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ Encore .setOutputPath('public/build/') // public path used by the web server to access the output path .setPublicPath('/build') - // only needed for CDN's or sub-directory deploy + // only needed for CDN's or subdirectory deploy //.setManifestKeyPrefix('build/') /* @@ -44,14 +44,15 @@ Encore // enables hashed filenames (e.g. app.abc123.css) .enableVersioning(Encore.isProduction()) - .configureBabel((config) => { - config.plugins.push('@babel/plugin-proposal-class-properties'); - }) + // configure Babel + // .configureBabel((config) => { + // config.plugins.push('@babel/a-babel-plugin'); + // }) - // enables @babel/preset-env polyfills + // enables and configure @babel/preset-env polyfills .configureBabelPresetEnv((config) => { config.useBuiltIns = 'usage'; - config.corejs = 3; + config.corejs = '3.23'; }) .copyFiles({